05.04.2014, 16:54
Haciї?
pawn Код:
if(strcmp(cmd, "/venderveh", true) == 0)
{
new giveplayerid;
new newcar = GetPlayerVehicleID(playerid);
persona[playerid] = giveplayerid ;
if(NFS(playerid))
{
if (!strlen(persona))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /venderveh [playerid/partOfName]");
return 1;
}
giveplayerid = ReturnUser(persona);
if (giveplayerid == INVALID_PLAYER_ID)
{
SendClientMessage(playerid, COLOR_GREY, "Jugador Off Line");
return 1;
}
if(IsAnOwnableCar(idcar))
{
if(PlayerInfo[giveplayerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_GREY, "Necesita Minimo Nivel 3, Para tener Un Coche..!");
return 1;
}
if(CarInfo[newcar][cOwned]==1)
{
SendClientMessage(playerid, COLOR_GREY, "Vendedor: Este Coche Ya Tiene Dueсo, Lo Siento.");
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
return 1;
}
if(PlayerInfo[giveplayerid][pPcarkey] == 999){}
else if(PlayerInfo[giveplayerid][pPcarkey2] == 999) { }
else { SendClientMessage(playerid, COLOR_GREY, "Unicamente Se Permite Tener 2 Coches Por Persona."); return 1; }
if(GetPlayerMoney(giveplayerid) >= CarInfo[idcar][cValue])
{
if(PlayerInfo[giveplayerid][pPcarkey] == 999) { PlayerInfo[giveplayerid][pPcarkey] = idcar; }
else if(PlayerInfo[giveplayerid][pPcarkey2] == 999) { PlayerInfo[giveplayerid][pPcarkey2] = idcar; }
else { return 1; }
ShowPlayerDialog(giveplayerid,2014,DIALOG_STYLE_MSGBOX,"Confirmacion","їDesea Aceptar este auto?","Si","No");
return 1;
}else SendClientMessage(playerid, COLOR_GREY, "Sin Dinero suficiente");
}
} else SendClientMessage(playerid, COLOR_GREY, "No Eres vendedor de autos");
return 1;
}