command for fix vehicle very simple question
#1

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?
Reply
#2

pawn Код:
if(GetPlayerMoney(playerid) <= 10000) return SendClientMessage...
Reply
#3

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/
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)