How to add a code into a gamemode? need help
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])  
{  
    new MSG[250];  
    new Name[MAX_PLAYER_NAME];  
    GetPlayerName(playerid,Name,sizeof(Name));  

    if (strcmp("/greet", cmdtext, true, 10) == 0)  
    {  
        if(PlayerInfo[playerid][pCop] == 1){  
            if(PlayerToPlayer(playerid,5, 10.0))
            {  
                format(MSG,sizeof(MSG),"Hello, I'm %s [Police Officer] with the Los Santos Police Department. Do you know why I stopped you today?", Name);  
                SendClientMessage(playerid, COLOR_WHITE, MSG);
            }
        }  
        return 1;  
    }  
    return 0;  
}  

stock PlayerToPlayer(playerid, targetid, Float:distance)  
{  
    new Float:x, Float:y, Float:z;  
    GetPlayerPos(playerid,x,y,z);  
    if(IsPlayerInRangeOfPoint(targetid,distance,x,y,z))  
    {  
        return true;  
    }  
    return false;  
}
Reply


Messages In This Thread
How to add a code into a gamemode? need help - by Samieastwood - 09.11.2014, 16:08
Re: How to add a code into a gamemode? need help - by k0r - 09.11.2014, 17:14
Re: How to add a code into a gamemode? need help - by Quickie - 09.11.2014, 23:19

Forum Jump:


Users browsing this thread: 1 Guest(s)