TheSmart Posted July 14, 2015 Posted July 14, 2015 Hello guys! i'm wanted to make if player group type is gang so he can't join police team so tell me how can i make it please i need this ASAP
Perfect Posted July 14, 2015 Posted July 14, 2015 What do you really mean by player group type ? player team, ACL group or something else. Multi Theft Auto Player since middle of 2011. Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.
TheSmart Posted July 14, 2015 Author Posted July 14, 2015 im trying it to make own self addEvent ("onPlayerJoinJob", true) addEventHandler( "onPlayerJoinJob", root, function (player) local gang = exports.NGGroups:getPlayerGroup ( player ) if ( getElementData(player, "Group" ) ~= "Gang" ) then i dont know what to do next
Cadell Posted July 14, 2015 Posted July 14, 2015 u want to compare if player is in any gang then cant spawn police else do local getPlayergang = exports.NGGroups:getPlayerGroup(player) if getPlayergang == "gangname here" then outputChatbox"u cant u r in gang" else --your spawn stuff end Script Trading Status Successful Trading : 26 Scam : 0 On Sale : Banking System SQL Based On Sale : Housing System MySQL Based Download and Support my new script on Community : http://community.mtasa.com/index.php?p=resources&s=details&id=11686 SQL Based Housing
LasHa Posted July 14, 2015 Posted July 14, 2015 i think you need to add new button in Group Gui. When player is going to create a group he need to choose which kind of group he is going to do like "Civilian" "Police" or "Criminal" or as you wish "Gang". after that you need to save somehow that group type is Gang and all players got from that type can't enter in police.
TheSmart Posted July 14, 2015 Author Posted July 14, 2015 (edited) after that you need to save somehow that group type is Gang and all players got from that type can't enter in police. -___________________- if i know how to do it so why i come here uffff Edited July 16, 2015 by Guest
Walid Posted July 14, 2015 Posted July 14, 2015 use return. Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
TheSmart Posted July 14, 2015 Author Posted July 14, 2015 can you explain me how to use return ? im nab scripting D:
GTX Posted July 15, 2015 Posted July 15, 2015 I think cancelEvent could do the job. I'm not familiar with xXMadeXx his group system. addEvent ("onPlayerJoinJob", true) addEventHandler( "onPlayerJoinJob", root, function (player) local gang = exports.NGGroups:getPlayerGroup ( player ) if gang ~= "Gang" then cancelEvent() end end ) Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS. Developer and owner of https://projectbea.st - Project Beast
TheSmart Posted July 16, 2015 Author Posted July 16, 2015 doesn't work elseif ( name == 'Police' ) then create3DText ( 'Police', { x, y, z }, { 0, 100, 255 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 281 ) setElementData ( p, "Position", { x, y, z, rz } ) createBlip ( x, y, z, 61, 2, 255, 255, 255, 255, 0, 450 ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if ( getPlayerWantedLevel ( p ) > max_wanted.law ) then return exports['NGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.law )..".", p, 255, 0, 0 ) end if gang ~= "Gang" then outputChatBox ("hHAHAHA you're in gang group nab", source ) cancelEvent() triggerClientEvent ( p, 'NGJobs:OpenJobMenu', p, 'police' ) end end )
darhal Posted July 16, 2015 Posted July 16, 2015 doesn't work elseif ( name == 'Police' ) then create3DText ( 'Police', { x, y, z }, { 0, 100, 255 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 281 ) setElementData ( p, "Position", { x, y, z, rz } ) createBlip ( x, y, z, 61, 2, 255, 255, 255, 255, 0, 450 ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if ( getPlayerWantedLevel ( p ) > max_wanted.law ) then return exports['NGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.law )..".", p, 255, 0, 0 ) end if gang ~= "Gang" then outputChatBox ("hHAHAHA you're in gang group nab", source ) cancelEvent() triggerClientEvent ( p, 'NGJobs:OpenJobMenu', p, 'police' ) end end ) elseif ( name == 'Police' ) then create3DText ( 'Police', { x, y, z }, { 0, 100, 255 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 281 ) setElementData ( p, "Position", { x, y, z, rz } ) createBlip ( x, y, z, 61, 2, 255, 255, 255, 255, 0, 450 ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if ( getPlayerWantedLevel ( p ) > max_wanted.law ) then return exports['NGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.law )..".", p, 255, 0, 0 ) end if gang ~= "Gang" then outputChatBox ("hHAHAHA you're in gang group nab", source ) return end end ) #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now