CMD:house(playerid, params[]) { new string[256], slot; if(sscanf(params,"s[256]z", string, slot)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /house [buy/sell/lock/unlock/putgun/takegun/inventory]"); if(!strcmp(string, "buy", true)) { BuyHouseForPlayer(playerid); return 1; } if(!strcmp(string, "sell", true)) { SellHouseForPlayer(playerid); return 1; } if(!strcmp(string, "lock", true)) { LockPlayerHouse(playerid); return 1; } if(!strcmp(string, "unlock", true)) { UnlockPlayerHouse(playerid); return 1; } if(!strcmp(string, "putgun", true)) { PutGunPlayerHouse(playerid, slot); return 1; } if(!strcmp(string, "takegun", true)) { TakeGunPlayerHouse(playerid, slot); return 1; } if(!strcmp(string, "inventory", true)) { CheckPlayerHouseInventory(playerid); return 1; } else { SendClientMessage(playerid, COLOR_GREY, "USAGE: /house [buy/sell/lock/unlock/putgun/takegun/inventory]"); } return 1; }
CMD:house(playerid, params[])
{
new
string[50]
;
if(sscanf(params,"s[50]", string))
return SendClientMessage(playerid, COLOR_GREY, "USAGE: /house [buy/sell/lock/unlock/putgun/takegun/inventory]");
if(!strcmp(string, "buy", true))
{
BuyHouseForPlayer(playerid);
return 1;
}
if(!strcmp(string, "sell", true))
{
SellHouseForPlayer(playerid);
return 1;
}
if(!strcmp(string, "lock", true))
{
LockPlayerHouse(playerid);
return 1;
}
if(!strcmp(string, "unlock", true))
{
UnlockPlayerHouse(playerid);
return 1;
}
if(!strcmp(string, "putgun", true))
{
PutGunPlayerHouse(playerid, slot);
return 1;
}
if(!strcmp(string, "takegun", true))
{
TakeGunPlayerHouse(playerid, slot);
return 1;
}
if(!strcmp(string, "inventory", true))
{
CheckPlayerHouseInventory(playerid);
return 1;
}
return 1;
}
don't exists Z parameter.
pawn Код:
|
if(!strcmp(string, "putgun", true)) { PutGunPlayerHouse(playerid, slot); return 1; } if(!strcmp(string, "takegun", true)) { TakeGunPlayerHouse(playerid, slot); return 1; }
if(sscanf(params,"s[50]I(-1)", string , slot ))
You could use the optional specifier option
pawn Код:
|
CMD:house(playerid, params[]) { new string[256], slot; if(sscanf(params,"s[256]I(1)", string, slot)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /house [buy/sell/lock/unlock/putgun/takegun/inventory]"); if(!strcmp(string, "buy", true)) { BuyHouseForPlayer(playerid); return 1; } if(!strcmp(string, "sell", true)) { SellHouseForPlayer(playerid); return 1; } if(!strcmp(string, "lock", true)) { LockPlayerHouse(playerid); return 1; } if(!strcmp(string, "unlock", true)) { UnlockPlayerHouse(playerid); return 1; } if(!strcmp(string, "putgun", true)) { PutGunPlayerHouse(playerid, slot); return 1; } if(!strcmp(string, "takegun", true)) { TakeGunPlayerHouse(playerid, slot); return 1; } if(!strcmp(string, "inventory", true)) { CheckPlayerHouseInventory(playerid); return 1; } else { SendClientMessage(playerid, COLOR_GREY, "USAGE: /house [buy/sell/lock/unlock/putgun/takegun/inventory]"); } return 1; }