Hello Guys i Wana Help From Command - 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)
+--- Thread: Hello Guys i Wana Help From Command (
/showthread.php?tid=464591)
Hello Guys i Wana Help From Command -
moustafa0550 - 17.09.2013
Hello Guys i Wana Help From Command where i paste this in folder name or where !
PHP код:
COMMAND:cuff(playerid, params[])
{
new pID, targetname[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
if(GetPlayerSkin(playerid) == 280 && 281) // Both IDs are police officer
{
GetPlayerName(pID, targetname, sizeof(targetname));
GetPlayerName(playerid, name, sizeof(name));
if (isnull(params)) return SendClientMessage(playerid, -1, "Usage: /cuff <playerid>");
format(string, sizeof(string), "You have been cuff by Police Officer %s", name);
format(string,sizeof(string), "You have cuff player %s", targetname);
SendClientMessage(pID, -1, string);
SendClientMessage(playerid, -1, string);
TogglePlayerControllable(pID, 0); // Freezes the player. Isn't /cuff in RP, a cmd to freeze?
} else return SendClientMessage(playerid, -1, "You need to have a police skin !");
return 1;
}
where i can paste it and work! And +Rep tell me
Re: Hello Guys i Wana Help From Command -
Blademaster680 - 17.09.2013
You could paste it anywhere in your code... I Prefer pasting it under my other commands though, just to keep everything together.
Re: Hello Guys i Wana Help From Command -
Konstantinos - 17.09.2013
Just to let you know; that command will only cuff the player with ID 0. You never assign an ID to
pID and neither using something to get the ID from. Use sscanf for the parameter, check if that player is not invalid player and then do the rest.
Re: Hello Guys i Wana Help From Command -
dino_d_carter - 17.09.2013
Quote:
Originally Posted by moustafa0550
Hello Guys i Wana Help From Command where i paste this in folder name or where !
PHP код:
COMMAND:cuff(playerid, params[])
{
new pID, targetname[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
if(GetPlayerSkin(playerid) == 280 && 281) // Both IDs are police officer
{
GetPlayerName(pID, targetname, sizeof(targetname));
GetPlayerName(playerid, name, sizeof(name));
if (isnull(params)) return SendClientMessage(playerid, -1, "Usage: /cuff <playerid>");
format(string, sizeof(string), "You have been cuff by Police Officer %s", name);
format(string,sizeof(string), "You have cuff player %s", targetname);
SendClientMessage(pID, -1, string);
SendClientMessage(playerid, -1, string);
TogglePlayerControllable(pID, 0); // Freezes the player. Isn't /cuff in RP, a cmd to freeze?
} else return SendClientMessage(playerid, -1, "You need to have a police skin !");
return 1;
}
where i can paste it and work! And +Rep tell me
|
You paste it where ever you want but ofc in pawno (in you gamemode), you need to have zcmd you can download it from forum and then #include zcmd.