PHP код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
new IDMECANICO[MAX_PLAYERS];
CMD:reparo(playerid,params[])
{
new ID, Valor;
if(sscanf(params,"dd",ID, Valor)) return SendClientMessage(playerid, 0xC4C4C4FF, "Use /reparo [id] [valor]");
if(IsPlayerConnected(ID))
{
IDMECANICO[ID] = playerid;
new name[MAX_PLAYER_NAME], string[64+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "O mecanico %s estб lhe oferencedo seu servico por R$:%i Use /aceitar ou /recusar", name,Valor);
SendClientMessage(ID,0xC4C4C4FF, string);
}
else
{
SendClientMessage(playerid, 0xC4C4C4FF, "O player nгo estб conectado!");}
return 1;
}
CMD:aceitar(playerid,params[])
{
if( IDMECANICO[playerid] == 1001)
{
SendClientMessage(playerid,0xC4C4C4FF, "Vocк jб aceitou o convite!");
}
else
{
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME],Float:x,Float:y,Float:z;
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s Aceitou seus servicos!", name);
SendClientMessage(IDMECANICO[playerid],0xC4C4C4FF, string);
GetPlayerPos(playerid,x,y,z);
SetPlayerCheckpoint(IDMECANICO[playerid], x,y,z, 3.0);
IDMECANICO[playerid] = 1001;
}
return 1;
}
CMD:recusar(playerid,params[])
{
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s Recusou seus servicos!", name);
SendClientMessage(IDMECANICO[playerid],0xC4C4C4FF, string);
IDMECANICO[playerid] = 1001;
return 1;
}