SA-MP Forums Archive
Phone commands. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Phone commands. (/showthread.php?tid=139359)



Phone commands. - Steven82 - 04.04.2010

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;
	}



Re: Phone commands. - Last_Stand_Guardian - 04.04.2010

What exactly doesn't work? :O


Re: Phone commands. - Steven82 - 04.04.2010

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



Re: Phone commands. - Last_Stand_Guardian - 04.04.2010

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?


Re: Phone commands. - westre - 04.04.2010

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


Re: Phone commands. - Steven82 - 05.04.2010

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