27.10.2013, 17:25
Need help with this cmd .. I is changing all gates pws not ones... could I ask for help..
I think something about looping..
I think something about looping..
pawn Код:
CMD:admingatepw(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pShopTech] == 1)
{
new string[128], gateid, pass[24];
if(sscanf(params, "ds[24]", gateid, pass)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /admingatepw [gateid] [pass]");
if(strlen(pass) > 24)
{
SendClientMessageEx(playerid, COLOR_GRAD2, " Must be 24 characters or less! ");
return 1;
}
format(string, sizeof(string), "Gate Password for gate %d changed to %s", gateid, pass);
format(GateInfo[gateid][gPass], 24, "%s", pass);
SendClientMessageEx(playerid, COLOR_GRAD2, string);
SaveGates();
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
return 1;
}
return 1;
}