How to create command /sellcarto ???
#1

Hello, iam having problem with putting script in right order to create command /givecarto giving car to other player, maybe could help me?
I have this:

pawn Код:
CMD:givecarto(playerid, params[])
{
    new playerb;
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USE: /givecarto [playerid]");
    if(!PlayerInfo[playerid][pVeh]) return SendClientMessage(playerid, COLOR_GREY, "You dont own a car.");
    if(!IsPlayerLoggedIn(playerb) && !IsPlayerNPC(playerb)) return SendClientMessage(playerid, COLOR_GREY, "There a no such player.");
    if(PlayerInfo[playerb][pVIP] >= 2)
    {
        if(PlayerInfo[playerb][vModel] && PlayerInfo[playerb][vVModel])
        {
            SendClientMessage(playerid, COLOR_GREY, "* The player owned a car.");
            return 1;
        }
    }
    if(PlayerInfo[playerb][vModel])
    {
        SendClientMessage(playerid, COLOR_GREY,"* The player owned 2 cars.");
        return 1;
    }
    if(PlayerInfo[playerb][pVIP] >= 2 && PlayerInfo[playerb][vModel])
    {
        PlayerInfo[playerb][pVVeh] = PlayerInfo[playerid][pVeh];
        SetVehicleParamsEx(PlayerInfo[playerb][pVVeh], 0, 0, 0, 1, 0, 0, 0);
        PlayerInfo[playerb][vVLocked] = 1;
        PlayerInfo[playerb][vVModel] = PlayerInfo[playerid][pVeh];
        GetVehiclePos(PlayerInfo[playerb][pVeh], PlayerInfo[playerb][vVX], PlayerInfo[playerb][vVY], PlayerInfo[playerb][vVZ]);
        GetVehicleZAngle(PlayerInfo[playerb][pVeh], PlayerInfo[playerb][vA]);
        PlayerInfo[playerb][vVC1] = 0;
        PlayerInfo[playerb][vVC2] = 0;
        }else{
        PlayerInfo[playerb][pVeh] = PlayerInfo[playerid][pVeh];
        SetVehicleParamsEx(PlayerInfo[playerb][pVeh], 0, 0, 0, 1, 0, 0, 0);
        PlayerInfo[playerb][vLocked] = 1;
        PlayerInfo[playerb][vModel] = PlayerInfo[playerid][pVeh];
        GetVehiclePos(PlayerInfo[playerb][pVeh], PlayerInfo[playerb][vX], PlayerInfo[playerb][vY], PlayerInfo[playerb][vZ]);
        GetVehicleZAngle(PlayerInfo[playerb][pVeh], PlayerInfo[playerb][vA]);
        PlayerInfo[playerb][vC1] = 0;
        PlayerInfo[playerb][vC2] = 0;
    }
    PlayerInfo[playerid][pVeh] = 0;
    PlayerInfo[playerid][vModel] = 0;
    PlayerInfo[playerid][vX] = 0;
    PlayerInfo[playerid][vY] = 0;
    PlayerInfo[playerid][vZ] = 0;
    PlayerInfo[playerid][vA] = 0;
    PlayerInfo[playerid][vC1] = 0;
    PlayerInfo[playerid][vC2] = 0;
    SendClientMessage(playerid, COLOR_GREEN, " You dont own that car.");
    return 1;
}
Reply
#2

Please put that code into brackets so we can see it and help you. Like this: [ pawn ] codehere [ /pawn] (remove the spaces when you do it) Also whats the problem with it?
Reply
#3

delete
Reply
#4

Quote:
Originally Posted by jakejohnsonusa
Посмотреть сообщение
Please put that code into brackets so we can see it and help you. Like this: [ pawn ] codehere [ /pawn] (remove the spaces when you do it) Also whats the problem with it?
sorry for that, the problem that all would be great until the player which is geting the car, make relog and he doesnt own any car...
i think its because cordinates of the car doesnt saving in to player acc...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)