Vehicle Help Command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Vehicle Help Command (
/showthread.php?tid=370909)
Vehicle Help Command -
UnknownGamer - 21.08.2012
Код:
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))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/v)ehicle plate [text]");
return 1;
}
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2])
{
new ownvehkey;
new vehid;
vehid = GetPlayerVehicleID(playerid);
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { ownvehkey = PlayerInfo[playerid][pPcarkey]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { ownvehkey = PlayerInfo[playerid][pPcarkey2]; }
else { return 1; }
if(strcmp(sendername, CarInfo[ownvehkey][cOwner], true) == 0)
{
if(GetPlayerMoney(playerid) < 5000)
{
SendClientMessage(playerid,COLOR_WHITE,"You need 5000$ for the Plate Change!");
return 1;
}
strmid(CarInfo[vehid][cPlate], result, 0, strlen(result), 999);
GivePlayerMoney(playerid,-5000);
SetVehicleNumberPlate(vehid, CarInfo[cPlate]);
RemovePlayerFromVehicle(playerid);
PlayerInfo[playerid][pPChanges] -= 1;
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
OnPropUpdate(4,vehid);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Please sit in your car before selling! ");
return 1;
}
}
Why does this not update the vehicle plate? It looks okay to me?
Re: Vehicle Help Command -
lamarr007 - 21.08.2012
You must respawn that vehicle after changing plate.
Re: Vehicle Help Command -
UnknownGamer - 21.08.2012
It already does SetVehicleToRespawn(GetPlayerVehicleID(playerid));