SA-MP Forums Archive
[HELP] ZCMD Issue - 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: [HELP] ZCMD Issue (/showthread.php?tid=193737)



[HELP] ZCMD Issue - [UG]Scripter - 27.11.2010

Hey,

This command will not work. It's ment to allow a cop or firefight to type the command then a players ID and send the repsonse message to them.....


pawn Код:
COMMAND:res(playerid,giveplayerid,params[])
{
if(PlayerTeam[playerid] == Team_Fire || PlayerTeam[playerid] == Team_EMS || PlayerTeam[playerid] == Team_Sheriff || PlayerTeam[playerid] == Team_LVPD)
if(PlayerTeam[playerid] == Team_Civ) return SendClientMessage(playerid,COLOR_YELLOW,"[INFO]: Un-Authorised Command Attempt!");
new string[128];
new sendername[MAX_PLAYER_NAME];
//***** Sent to Civ ****
format(string, sizeof(string),"[CALL]: A call from 911: A unit Has Been Dispatched to investigate your call, Please stay where you are");
SendClientMessage(giveplayerid,COLOR_YELLOW,string);
// **** Police Radio ***
format(string,sizeof(string),"[911]: Unit %s reponding to %s's Call, Over",sendername,giveplayerid);
SendMessageToLaw(string);
// *** End ****
return 1;
}



Re: [HELP] ZCMD Issue - Jochemd - 27.11.2010

Use sscanf to format the params.


Re: [HELP] ZCMD Issue - [UG]Scripter - 27.11.2010

No Idea how to......


Re: [HELP] ZCMD Issue - Cameltoe - 27.11.2010

pawn Код:
COMMAND:res(playerid,giveplayerid,params[])
{
new pID,  string[128];
// restricted teams here
if(PlayerTeam[playerid] == Team_Civ) return SendClientMessage(playerid,COLOR_YELLOW,"[INFO]: Un-Authorised Command Attempt!");
if(sscanf(params, "u", pID)) return SendClientMessage(playerid,COLOR_YELLOW,"[USAGE]: /res [ playerid / name ]");
format(string, sizeof(string),"[CALL]: A call from 911: A unit Has Been Dispatched to investigate your call, Please stay where you are");
SendClientMessage(pID,COLOR_YELLOW,string);
format(string,sizeof(string),"[911]: Unit %d reponding to %d's Call, Over",playerid, pID);
SendMessageToLaw(string);
return 1;
}



Re: [HELP] ZCMD Issue - [UG]Scripter - 29.11.2010

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
pawn Код:
COMMAND:res(playerid,giveplayerid,params[])
{
new pID,  string[128];
// restricted teams here
if(PlayerTeam[playerid] == Team_Civ) return SendClientMessage(playerid,COLOR_YELLOW,"[INFO]: Un-Authorised Command Attempt!");
if(sscanf(params, "u", pID)) return SendClientMessage(playerid,COLOR_YELLOW,"[USAGE]: /res [ playerid / name ]");
format(string, sizeof(string),"[CALL]: A call from 911: A unit Has Been Dispatched to investigate your call, Please stay where you are");
SendClientMessage(pID,COLOR_YELLOW,string);
format(string,sizeof(string),"[911]: Unit %d reponding to %d's Call, Over",playerid, pID);
SendMessageToLaw(string);
return 1;
}
Didnt work, Displays The Text But not the players name.


Re: [HELP] ZCMD Issue - Cameltoe - 29.11.2010

Quote:
Originally Posted by [UG]Scripter
Посмотреть сообщение
Didnt work, Displays The Text But not the players name.
I've just included the id's as i got no clue how you get the player's name, if you use a stock or whatever ..

pawn Код:
stock GetPlayerNameEx(playerid) // This is how i do it.
{
     new pName[25];
     GetPlayerName(playerid, pName, sizeof(pName));
     return pName;
}
Now just change pID and playerid in your command to: GetPlayerNameEx(pID) & GetPlayerNameEx(playerid)


Re: [HELP] ZCMD Issue - Rachael - 29.11.2010

have you in any way altered the native zcmd function to allow for the 'giveplayerid' variable to be present in the function definition?
pawn Код:
CMD:res(playerid,params[])