24.09.2011, 13:59
i got 4 commands i want i got ,nos,repair,hy i no how to make it so u have to have score to be able to use it.
how i make it send a message if you are not at that score
i have tried a few things and it is annoying me
how i make it send a message if you are not at that score
i have tried a few things and it is annoying me
pawn Код:
if(!strcmp(command, "/repair", true))
{
if(!IsPlayerInAnyVehicle(playerid))
if(GetPlayerScore(playerid) >= 100)
{
return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
}
RepairVehicle(GetPlayerVehicleID(playerid));
SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
GivePlayerMoney(playerid, -200);
SendClientMessage(playerid, 0xFFFFFFFF, "{00ff00}Vehicle Repaired {ff0000}$200");
return 1;
}
pawn Код:
if(strcmp("/flip", cmdtext, true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerScore(playerid) >= 100)
{
new vehicle;
new Float:zangle;
vehicle = GetPlayerVehicleID(playerid);
GetVehicleZAngle(vehicle,zangle);
SetVehicleZAngle(vehicle,zangle);
SendClientMessage(playerid, COLOR_NAVY, "[APS]Vehicle Flipped");
}
}
return 1;
}
pawn Код:
if(!strcmp(command, "/hy",true))
{
if(GetPlayerVehicleID(playerid) != 0)
{
new LModel = GetVehicleModel(GetPlayerVehicleID(playerid));
switch(LModel)
{
case 448,461,462,463,468,471,509,510,521,522,523,581,586,449:
return SendClientMessage(playerid,red,"ERROR: You can not tune this vehicle!");
}
AddVehicleComponent(GetPlayerVehicleID(playerid), 1087);
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid, red, "ERROR: You are not in a vehicle");
}
return 1;
}
pawn Код:
if (strcmp("/nos", cmdtext, true) == 0)
{
new vehicle = GetPlayerVehicleID(playerid);
if(GetPlayerScore(playerid) >= 100)
{
AddVehicleComponent(vehicle, 1010);
SendClientMessage(playerid, COLOR_NAVY, "{00ff00}Nos Added");
return 1;
}
}