12.12.2011, 14:30
(
Последний раз редактировалось Min; 22.01.2012 в 10:15.
)
Hello guys, how to maximum this command after the players has used it 4 times?
This is the script:
This is the script:
Код:
#include <a_samp>
#define ORANGE 0xFF5F11FF
#define RED 0xFF0000AA
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/fix", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerMoney(playerid) >= 300)
{
SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0);
RepairVehicle(GetPlayerVehicleID(playerid));
GivePlayerMoney(playerid,-2500);
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
SendClientMessage(playerid, ORANGE, "You have fixed your vehicles for $2500.");
}
else
{
SendClientMessage(playerid,RED,"You don't have enough money to use this command.");
}
}
else
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
CreateVehicle(468, x, y, z, 82.2873, 0, 1, 60);
GivePlayerMoney(playerid,-4000);
SendClientMessage(playerid, ORANGE, "You have bought your new vehicle for $4000.");
}
return 1;
}
return 0;
}

