05.11.2011, 03:48
Olha ae manin
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/reparar", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerMoney(playerid) <= 100)
{
RepairVehicle(GetPlayerVehicleID(playerid));
format(string, sizeof(string), "[INFO] %s (ID:%d) Reparou o seu Veнculo ( /Reparar )", pNome(playerid), playerid);
SendClientMessageToAll(-1, string);
GivePlayerMoney(playerid, -100);
}
else
{
SendClientMessage(playerid, -1, "[ERRO] Erro vocк nгo tem $100!");
}
}
else
{
SendClientMessage(playerid, -1, "[ERRO] {FFFF00}Vocк nгo estб em um Veнculo!");
}
return PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
}
return 0;
}
stock pNome(playerid)
{
new nome[MAX_PLAYERS];
GetPlayerName(playerid, nome, MAX_PLAYERS);
return nome;
}