SA-MP Forums Archive
How to create command /sellcarto ??? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to create command /sellcarto ??? (/showthread.php?tid=411880)



How to create command /sellcarto ??? - Eley999 - 30.01.2013

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;
}



Re: How to create command /sellcarto ??? - jakejohnsonusa - 30.01.2013

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?


Re: How to create command /sellcarto ??? - shoaib_sait - 31.01.2013

delete


Re: How to create command /sellcarto ??? - Eley999 - 31.01.2013

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...