Problem with car purchase - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem with car purchase (
/showthread.php?tid=215734)
Problem with car purchase -
Roma555 - 24.01.2011
Problem such:
It is necessary that when the car Spawn, a variable ' statussultan ' became on ' 0'
Here is how did:
new statussultan;
Код:
if (strcmp("/buycar1", cmdtext, true) == 0)
{
if(statussultan == 0)
{
SendClientMessage(playerid, 0xFF0000FF, "You have bought this car");
statussultan = 1;
}
return 1;
}
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
{
new buyvehicl = GetPlayerVehicleID(playerid);
if(buyvehicl == buycar)
{
if(statussultan == 0)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, 0xB50F00AA, "Will buy the car to sit down");
statussultan = 0;
}
}
else if(statussultan == 1)
{
statussultan = 1;
}
}
Here in it public should on '0'
Код:
public OnVehicleSpawn(vehicleid)
{
statussultan = 0; // Doesn't become on ' 0'
return 1;
}
How to make that became on ' 0 '?
Re: Problem with car purchase -
Roma555 - 24.01.2011
Who can help?
Re: Problem with car purchase -
Steven Paul - 24.01.2011
hmm. There is also a NON-ENGLISH section. I think that can help you