Function for a specific group
#1

Hello, how do I make "SetPlayerMarkerForPlayer" show to a certain group of players?:
Код:
if(PLAYER_TEMP[i][pt_WORKING_IN] == WORK_POLICE)
Reply
#2

Considering that you want to do something related to a function, I will try my best to show you an example.

pawn Код:
FunctionName( playerid, var1 ){
    foreach( new i : OnDutyCops ){
        //Example:
        SetPlayerMarkerForPlayer( i, var1, COLOR_LIGHTRED ) ;
        SCMEx( i, COLOR_YELLOWG, "debug: Player %d location marked with COLOR_LIGHTRED", var1 ) ;
    }}
    return 1 ;
}
The way foreach works is documented on the forums, basically is initiating the array in your enums file / part of the gamemode, and then you add a player to the OnDutyCops every time he does /duty and remove him when he goes off-duty. Is a better practice, and better than for( new i; etc. ) stuff.
Reply
#3

ty
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)