25.02.2017, 02:26
PHP код:
else if(strcmp(texto,"arma",true) == 0)
{
GetPlayerPos(ofertador[playerid], x,y,z);
if(ofertador[playerid] == INVALID_PLAYER_ID) return SCM(playerid, -1, "No te ofrecieron un {00CC00}arma{FFFFFF}.");
if(Jugador[playerid][Dinero] < dinerop[playerid]) return SCM(playerid,-1,"No tienes el {00CC00}dinero{FFFFFF} que te piden.");
if(!IsPlayerInRangeOfPoint(playerid, 2.0, x,y,z)) return SCM(playerid,-1,"Tienes que estar cerca del {00CC00}vendedor{FFFFFF}.");
if(!CheckArma(ofertador[playerid],ArmaOfert[playerid])) return SCM(playerid,-1,"El jugador ya no tiene el arma que te ha ofrecido");
DarArma(playerid,ArmaOfert[playerid]);
QuitarArma(ofertador[playerid],ArmaOfert[playerid]);
QuitarDinero(playerid,dinerop[playerid]);
DarDinero(ofertador[playerid],dinerop[playerid]);
ofertador[playerid] = INVALID_PLAYER_ID;
ArmaOfert[playerid] = 0;
if(TimerOfertaP[playerid] != -1)
{
KillTimer(TimerOfertaP[playerid]);
TimerOfertaP[playerid] = -1;
}
if(TimerTiempoV[ofertador[playerid]] != -1)
{
KillTimer(TimerTiempoV[ofertador[playerid]]);
TimerTiempoV[ofertador[playerid]] = -1;
}
}