Minor help with a snippet
#1

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");
}
Reply
#2

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");
}
Reply
#3

Edit: Nevermind.
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)