Problema al poner /aceptar car
#1

BUenas, he creado la faccion NFS y ahora estaba poniendo el /vendercoche para que un nfs se suba a un coche se lo pueda vender a una persona sin comprarlo. Pero al aceptar el coche dice que nadie se lo ha ofrecido.

if(strcmp(cmd,"/vendercoche",true)==0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pLeader] != 27|| PlayerInfo[playerid][pMember] != 27)
{

if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid,COLOR_GREY," No estas en un coche !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USO: /vendercoche [playerid/PartOfName] [precio]");
return 1;
}
//giveplayerid = strval(tmp);
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USO: /vendercoche [playerid/PartOfName] [precio]");
return 1;
}
new money = strval(tmp);
if(money < 1 || money > 99999) { SendClientMessage(playerid, COLOR_GREY, " El precio debe situarse entre 1 y 99999$ !"); return 1; }
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_GREY, " No puedes vendertelo a ti mismo!");
return 1;
}
if(CarCalls[giveplayerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " El jugador ya compro un coche, tiene que usar /llamarcoche primero !");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Ofreciste a %s comprar un coche por $%d .",giveplayer, money);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Seсor: %s Te Ofreciу Su Coche Por: $%d (escribe /aceptar car para comprarlo).",sendername, money);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
CarOffer[playerid] = playerid;
CarPrice[giveplayerid] = money;
CarID[giveplayerid] = GetPlayerVehicleID(playerid);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " El jugador no esta cerca tuyo !");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " ID o nombre invalido !");
return 1;
}
}
}
return 1;
}


else if(strcmp(x_job,"car",true) == 0)
{
if(CarOffer[playerid] < 999)
{
if(IsPlayerConnected(CarOffer[playerid]))
{
if(GetPlayerMoney(playerid) > CarPrice[playerid])
{
if(IsPlayerInVehicle(OwnableCarOffer[playerid], CarID[playerid]))
{
GetPlayerName(OwnableCarOffer[playerid], giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new points;
PlayerInfo[CarOffer[playerid]][pCarSkill] ++;
if(PlayerInfo[CarOffer[playerid]][pCarSkill] == 50)
{ SendClientMessage(CarOffer[playerid], COLOR_YELLOW, "* Your Car Dealer Skill is now Level 2, Players that buy Cars from you can call it more often."); }
else if(PlayerInfo[CarOffer[playerid]][pCarSkill] == 100)
{ SendClientMessage(CarOffer[playerid], COLOR_YELLOW, "* Your Car Dealer Skill is now Level 3, Players that buy Cars from you can call it more often."); }
else if(PlayerInfo[CarOffer[playerid]][pCarSkill] == 200)
{ SendClientMessage(CarOffer[playerid], COLOR_YELLOW, "* Your Car Dealer Skill is now Level 4, Players that buy Cars from you can call it more often."); }
else if(PlayerInfo[CarOffer[playerid]][pCarSkill] == 400)
{ SendClientMessage(CarOffer[playerid], COLOR_YELLOW, "* Your Car Dealer Skill is now Level 5, Players that buy Cars from you can call it more often."); }
new level = PlayerInfo[CarOffer[playerid]][pCarSkill];
if(level >= 0 && level <= 50) { points = 1; }
else if(level >= 51 && level <= 100) { points = 2; }
else if(level >= 101 && level <= 200) { points = 3; }
else if(level >= 201 && level <= 400) { points = 4; }
else if(level >= 401) { points = 4; }
format(string, sizeof(string), "* You bought a Car for $%d, from Car Dealer %s. (You can use /llamarcar %d times)",CarPrice[playerid],giveplayer,points);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* You sold your Car to %s for $%d, the player can use /llamarcar %d times.",sendername,CarPrice[playerid],points);
SendClientMessage(CarOffer[playerid], COLOR_WHITE, string);
PlayerInfo[CarOffer[playerid]][pPayCheck] += CarPrice[playerid] * 5;
SafeGivePlayerMoney(playerid, -CarPrice[playerid]);
RemovePlayerFromVehicle(CarOffer[playerid]);
CarCalls[playerid] = points;
CarOffer[giveplayerid] = 999;
CarPrice[playerid] = 0;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " The Car Dealer is not in the offerd Car !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You cant afford the Car !");
return 1;
}
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " No-one offered to buy a Car !");
return 1;
}
}
Reply
#2

1є usa [pawn] para poner codigos.
post =
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)