why this command dont work?
#1

Heey all,
Why this command dont work?
pawn Код:
if(!strcmp(cmdtext,"/selltest"))
    {
        if(GetPlayerVehicleID(playerid) == 520)
        {
            GivePlayerMoney(playerid,10000);
            SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have sold a vehicle to the shipyard for $10000.");// for $%d
            return 1;
        }
        if(GetPlayerVehicleID(playerid) == 521)
        {
            GivePlayerMoney(playerid,11000);
            SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have sold a vehicle to the shipyard for $11000.");// for $%d
            return 1;
        }
        return 1;
    }
Thank admigo
Reply
#2

put it in [pawn]use pawn tag
Reply
#3

I have now.
Reply
#4

you have to use GetVehicleModel to get the vehicle model, GetPlayerVehicleID returns the vehicle id.
Reply
#5

Dont work
Now i have :
pawn Код:
if(!strcmp(cmdtext,"/selltest"))
    {
        if(GetVehicleModel(playerid) == 520)
        {
            GivePlayerMoney(playerid,10000);
            SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have sold a vehicle to the shipyard for $10000.");// for $%d
            return 1;
        }
        if(GetVehicleModel(playerid) == 521)
        {
            GivePlayerMoney(playerid,11000);
            SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have sold a vehicle to the shipyard for $11000.");// for $%d
            return 1;
        }
        return 1;
    }
Reply
#6

GetVehicleModel takes 1 argument, which is vehicleid. To get the player's vehicleid you would use GetPlayerVehicleID. To get the model of the vehicle that the player is inside, you would use GetVehicleModel(GetPlayerVehicleID(playerid)).
pawn Код:
if(!strcmp(cmdtext,"/selltest"))
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 520)
        {
            GivePlayerMoney(playerid,10000);
            SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have sold a vehicle to the shipyard for $10000.");// for $%d
            return 1;
        }
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 521)
        {
            GivePlayerMoney(playerid,11000);
            SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have sold a vehicle to the shipyard for $11000.");// for $%d
            return 1;
        }
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)