Help: Command to make Player say certain thing
#8

Not tested:

PHP Code:
public OnPlayerCommandText(playeridcmdtext[])
{
new 
MSG[250];
new 
Name[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,sizeof(Name));
    if (
strcmp("/greet"cmdtexttrue10) == 0)
    {
        if(
PlayerInfo[playerid][pCop] == 1){
            if(
PlayerToPlayer(playerid,510.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(playeridCOLOR_WHITEMSG);{
        return 
1;
    }
    return 
0;
}
stock PlayerToPlayer(playeridtargetidFloat:distance)
{
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(playerid,x,y,z);
    if(
IsPlayerInRangeOfPoint(targetid,distance,x,y,z))
    {
        return 
true;
    }
    return 
false;

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)