Command problem - 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: Command problem (
/showthread.php?tid=558987)
Command problem -
Rabea - 20.01.2015
This command works only on id 0, the problem is with "playerb"
Can anyone fix it?
pawn Код:
CMD:stealclothes(playerid, params[])
{
new playerb, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /stealclothes [playerid]");
if(!IsALeone(playerid) && !IsACorleone(playerid) && !IsALaVice(playerid) && !IsAESF(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not a member of any criminal faction.");
if(IsPlayerNearPlayer(playerid, playerb, 2)) return SendClientMessage(playerid, COLOR_GREY, "You are not close enough at the player");
if(!IsPlayerKnocked(playerb))return SendClientMessage(playerid, COLOR_GREY, "The player isn't knocked");
{
SetPlayerSkin(playerid, PlayerInfo[playerb][pModel]);
SetPlayerSkin(playerb, 252);
format(string, sizeof(string), "* %s has stole the clothes from %s.", RPN(playerid), RPN(playerb));
SendNearbyMessage(playerid, 15, string, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE);
}
return 1;
}
Re: Command problem -
xVIP3Rx - 20.01.2015
What does it say/do ?
pawn Код:
CMD:stealclothes(playerid, params[])
{
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
new playerb;
if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /stealclothes [playerid]");
if(!IsALeone(playerid) && !IsACorleone(playerid) && !IsALaVice(playerid) && !IsAESF(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not a member of any criminal faction.");
if(IsPlayerNearPlayer(playerid, playerb, 2)) return SendClientMessage(playerid, COLOR_GREY, "You are not close enough at the player");
if(!IsPlayerKnocked(playerb)) return SendClientMessage(playerid, COLOR_GREY, "The player isn't knocked");
string[128];
format(string, sizeof(string), "%s's new skin: %d", RPN(playerid), PlayerInfo[playerb][pModel]);
SendClientMessageToAll(-1, string);
SetPlayerSkin(playerid, PlayerInfo[playerb][pModel]);
SetPlayerSkin(playerb, 252);
format(string, sizeof(string), "* %s has stole the clothes from %s.", RPN(playerid), RPN(playerb));
SendNearbyMessage(playerid, 128, string, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE);
return 1;
}
added a simple debug,