10.12.2011, 04:27
pawn Код:
if(strcmp(x_nr,"plate",true) == 0)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/v)ehicle plate [text]");
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid,COLOR_WHITE,"You need 5000$ for the Plate Change!");
new vid = GetPlayerVehicleID(playerid);
strmid(CarInfo[vid][cPlate], result, 0, strlen(result), 999);
GivePlayerMoney(playerid,-5000);
SetVehicleNumberPlate(vid, CarInfo[vid][cPlate]);
RemovePlayerFromVehicle(playerid);
PlayerInfo[playerid][pPChanges] -= 1;
SetVehicleToRespawn(vid);
OnPropUpdate(4,vid);
return 1;
}