07.01.2013, 12:40
Hey,
i Have a commands like /N, /Rainbowcar, But, i want if the player will have 10,000$
So its will give him it,
and if no, its will say that he cant, look my commands.
Something..? Some 1 helP?
i Have a commands like /N, /Rainbowcar, But, i want if the player will have 10,000$
So its will give him it,
and if no, its will say that he cant, look my commands.
PHP код:
if (strcmp("/rainbowcar", cmdtext, true, 14) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerMoney(playerid) >= 10000)
{
SendClientMessage(playerid, COLOR_RED, "You Spend Now 10,000$ On Rainbowcar, Enjoy.w ")
KillTimer(CTimer2);
KillTimer(CTimer3);
KillTimer(CTimer4);
KillTimer(CTimer5);
KillTimer(CTimer6);
KillTimer(CTimer7);
KillTimer(CTimer8);
KillTimer(CTimer9);
KillTimer(CTimer10);
KillTimer(CTimer11);
CTimer1 = SetTimerEx("Color1", 500, 0, "d" ,playerid);
GivePlayerMoney(playerid, GetPlayerMoney(playerid) - 10000);
}
if(GetPlayerMoney(playerid) < 10000)
{
SendClientMessage(playerid, -1, "You dont have enough money");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not in a vehicle.");
}
}
PHP код:
if(!strcmp(cmdtext,"/nos",true))
{
if(NosOnByAdmin == 0)
{
SendClientMessage(playerid, 0xFF0000FF, "האדמין לא הפעיל את אפשרות הנייטרוס, מצטערים.");
}
if(NosOnByAdmin == 1)
{
if(GetPlayerMoney(playerid) > 10000)
{
GivePlayerMoney(playerid, GetPlayerMoney(playerid) -10000);
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFF0000AA,"You are not in a vehicle! - אתה לא בתוף רכב!"); // If the player is not in vehicle...
if(GetVehicleComponentInSlot(GetPlayerVehicleID(playerid),GetVehicleComponentType(1010)) != 1010) // Check if the vehicle has no nitro
{
AddVehicleComponent(GetPlayerVehicleID(playerid),1010); // Adding nitro
PlayerPlaySound(playerid,1133,0.0,0.0,0.0); // Sound of vehicle improving
SendClientMessage(playerid, 0xFF0000FF, "You add nitro to your car ! - הוספת נייטרוס לרכבך בהצלחה !");
}
if(GetPlayerMoney(playerid) < 10000)
{
SendClientMessage(playerid, -1, "You dont have enough money");
}
}
}
}
return 1;
}