command for fix vehicle very simple question - 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: command for fix vehicle very simple question (
/showthread.php?tid=156113)
command for fix vehicle very simple question -
oOhossamOo - 21.06.2010
hi i know my questions too many sory
Код:
#include <a_samp>
#include <anticheatfs>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("hossam");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print(" by hossam");
}
#endif
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/fixv", cmdtext, true, 10) == 0)
{
new VehicleID = GetPlayerVehicleID(playerid);
RepairVehicle(VehicleID);
SetVehicleHealth(VehicleID, 1000);
GivePlayerMoney(playerid, - 10000);
return 1;
}
return 0;
}
i maked new command that fix car but when i type /fixv i will fix car while i donot have enough money it will give me by -
i want show for a player you don't have enough money ? can any one do it please?
Re: command for fix vehicle very simple question -
russo666 - 21.06.2010
pawn Код:
if(GetPlayerMoney(playerid) <= 10000) return SendClientMessage...
Re: command for fix vehicle very simple question -
CuervO - 21.06.2010
just make a simple check
pawn Код:
if (strcmp("/fixv", cmdtext, true, 10) == 0)
{
new VehicleID = GetPlayerVehicleID(playerid);
new money = GetPlayerMoney(playerid); // check the money
if(money > 9999) // check if the player has more than 10000
{
RepairVehicle(VehicleID); // repair already sets the car hp to 1000, not needed to set it apart.
GivePlayerMoney(playerid, - 10000);
}
return 1;
}
You must make a money check, you can always check the wiki first....
https://sampwiki.blast.hk/
Re: command for fix vehicle very simple question -
oOhossamOo - 21.06.2010
Quote:
Originally Posted by CueЯvo
just make a simple check
pawn Код:
if (strcmp("/fixv", cmdtext, true, 10) == 0) { new VehicleID = GetPlayerVehicleID(playerid); new money = GetPlayerMoney(playerid); // check the money if(money > 9999) // check if the player has more than 10000 { RepairVehicle(VehicleID); // repair already sets the car hp to 1000, not needed to set it apart. GivePlayerMoney(playerid, - 10000); } return 1; }
You must make a money check, you can always check the wiki first.... https://sampwiki.blast.hk/
|
thanks its work perefect