28.01.2014, 09:20
PHP код:
CMD:buycar(playerid, params[])
{
new string[128], vslot;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!IsPlayerInRangeOfPoint(playerid, 2, -135.0201,1116.2260,20.1966)) return SendClientMessage(playerid, COLOR_GREY, "You are not near the vehicles dealership.");
if(PlayerInfo[playerid][vModel] && PlayerInfo[playerid][vVModel] && PlayerInfo[playerid][vVVModel])
{
format(string, sizeof(string), "You already own vehicles ID %d and %d and %d.", PlayerInfo[playerid][pVeh], PlayerInfo[playerid][pVVeh], PlayerInfo[playerid][pVVVeh]);
SendClientMessage(playerid, COLOR_GREY, string);
}
if(sscanf(params, "i", vslot)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /buycar [slot]");
if(vslot < 1 || vslot > 3) return SendClientMessage(playerid, COLOR_WHITE, "There are only 3 slots");
switch(vslot)
{
case 1: Wannabuycarinslot[playerid] = 1;
case 2: Wannabuycarinslot[playerid] = 2;
case 3: Wannabuycarinslot[playerid] = 3;
}
else SSSShowDialog(playerid, 10);
return 1;
}
Error:
error 029: invalid expression, assumed zero