30.04.2012, 23:34
hi im trieing to make a /setgang command but i can't get it to work.
pawn Код:
CMD:setgang(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,COLOR_RED,"You Are not admin level 2");
new id, Gangid;
if(sscanf(params,"uc", id, Gangid)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /MakeGang [playerid] [gangid]");
else if(Gangid > 0 || Gangid < 2) return SendClientMessage(playerid,COLOR_RED,"ERROR: Invalid gang ID!");
else if(Gangid == PlayerInfo[playerid][pGang]) return SendClientMessage(playerid,COLOR_RED,"ERROR: That player is all ready in that gang.");
else
{
new string [64];
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Gang",Gangid);
INI_Close(File);
format(string, sizeof(string), "Your gangid now is %s", Gangid);
SendClientMessage(id,COLOR_BLUE, string);
}
return 1;
}