08.07.2013, 13:53
thx mr ****** but am i doing this correct? the first string will be the option that save up to 10 cells which only involve between name and location only then the second string is for the name and loc thats why i made new name and loc variable that will save 32 cells for the name and location you will input
pawn Код:
new i,option[10],string[200];
if(sscanf(params, "is[10]",i,option))
{
SCM(playerid, -1, "[Usage]: /credit [robid] [option]");
SCM(playerid, -1, "OPTIONS: name | location | robcash");
return 1;
}
if(!strcmp(option, "name", true, 4))
{
new name[32];
if(sscanf(params, "is[10]s[32]",i,option,name)) return SCM(playerid,-1, "[Usage]: /credit [robid] name [name]");
if(PickInfo[i][pPick] == 0) return SendClientMessage(playerid,-1, "Invalid door id.");
format(string, sizeof(string), " You have set rob ID %d's name to %s",i,name);
SCM(playerid,COLOR_LIGHTBLUE, string);
PickInfo[i][pRname] = name;
}
if(!strcmp(option, "location", true, 8))
{
new loc[32];
if(sscanf(params, "is[10]s[32]",i,option,loc)) return SCM(playerid,-1, "[Usage]: /credit [robid] location [loc]");
if(PickInfo[i][pPick] == 0) return SendClientMessage(playerid,-1, "Invalid door id.");
format(string, sizeof(string), " You have set rob ID %d's location to %s",i,loc);
SCM(playerid,COLOR_LIGHTBLUE, string);
PickInfo[i][pLoc] = loc;
}