Minor help with a snippet - 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: Minor help with a snippet (
/showthread.php?tid=249232)
Minor help with a snippet -
Andregood - 17.04.2011
Well I'm basically in need of a rather small favor and that's making this snippet only for administrators as I am a novice in that area and haven't tried it before AT ALL, I'd appreciate if you did it for me to show as well as giving it to me, thanks.
Код:
command(setrace, playerid, params[])
{
new pID, tID;
if(sscanf(params, "ui", pID, tID)) return SendClientMessage(playerid, 0xAFAFAFAA, "Usage : /setrace [playerid/name] [teamid]");
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, 0xAFAFAFAA, "This player is not connected.");
SetPlayerTeam(pID, tID);
return SendClientMessage(playerid,0xAFAFAFAA, "Changed the player's race");
}
Re: Minor help with a snippet -
iJumbo - 17.04.2011
This?
pawn Код:
command(setrace, playerid, params[])
{
new pID, tID;
if(!IsPlayerAdmin(playerid) return SendClientMessage(playerid, 0xAFAFAFAA, "You need to be rcon admin to use this command");
if(sscanf(params, "ui", pID, tID)) return SendClientMessage(playerid, 0xAFAFAFAA, "Usage : /setrace [playerid/name] [teamid]");
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, 0xAFAFAFAA, "This player is not connected.");
SetPlayerTeam(pID, tID);
return SendClientMessage(playerid,0xAFAFAFAA, "Changed the player's race");
}
Re: Minor help with a snippet -
Stigg - 17.04.2011
Edit: Nevermind.
Re: Minor help with a snippet -
Andregood - 17.04.2011
Hmmm.. I got this error though;
D:\SAMP Server\gamemodes\Vampires.pwn(173) : error 001: expected token: ")", but found "return"
If you could help me to solve it would be nice, thanks between.
Edit: I was able to fix it, thanks.