Phone commands.
#1

ok so i have a 911 call command but it doesn't work

Код:
if(strcmp("/call 911",cmdtext, true, 10) == 0)
	{
	  SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USECELLPHONE);
	  SendClientMessage(playerid,COLOR_DBLUE,"[911 Dispatch]: You have call 911, we are sending help now.");
		SendPlayerMessageToPlayer(TEAM_SFPD,TEAM_CIV,"[911 Dispatch]: Someone has called for help, we set a checkpoint to their location.");
		return 1;
	}
Reply
#2

What exactly doesn't work? :O
Reply
#3

The command, everything compiles, but when i do it, it doesn't notify anyone? Like i set it to notify
Код:
TEAM_SFPD
Reply
#4

I think that you can't use teams as receiver or sender (I'm not sure :O)
How have you defined the teams?
--> gTeam? SetPlayerTeam?
Reply
#5

pawn Код:
if(strcmp("/call",cmdtext, true, 10) == 0)
{
     new 2ndpara[128];
     new idx;
     2ndpara = strtok(cmdtext, idx);
   
     if(strcmp(2ndpara,"911",true) == 0)
    {
      SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USECELLPHONE);
      SendClientMessage(playerid,COLOR_DBLUE,"[911 Dispatch]: You have call 911, we are sending help now.");
      SendSFPDMessage(COLOR_GREEN,"[911 Dispatch]: Someone has called for help, we set a checkpoint to their location.");
    }
     return 1;
}
pawn Код:
stock SendSFPDMessage(color, string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i)) {
            if(gTeam[i] == /*yourSFPDnumber*/){
                SendClientMessage(i, color, string);
            }
        }
    }
}
UNTESTED
Reply
#6

Could i copy, paste the code again and exit to like
Код:
/call ems
Код:
/call taxi
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)