#1

I can not give a another player the car - Help please.

pawn Код:
if(strcmp(cmd, "/car", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
      tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_DGOLD, "KORISTENJE: /car [ID/DioImena]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 3)
            {
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        PutPlayerInVehicle(playerid, 424, 0);
                        return 1;
                    }
                }//not connected
            }
            else
            {
                format(string, sizeof(string), "ERROR: Igrac %s nije aktivan igrac. Pokusajte kasnje opet.", giveplayerid);
                SendClientMessage(playerid, COLOR_LIGHTRED, string);
            }
        }
        return 1;
    }
Reply
#2

change this line
pawn Код:
PutPlayerInVehicle(playerid, 424, 0);
with
pawn Код:
PutPlayerInVehicle(giveplayerid, 424, 0);
Reply
#3

nothing happens when i type ingame the command


EDIT: So guys, with this command i will spawn a car with the "ID 424", and i want to be in it, when it spawn.
Reply
#4

are your admin level is 3 ?
Reply
#5

You have to CreateVehicle first, Get the vehicle id, then do PutPlayerInVehicle(playerid,vehicleid,0).

You are confusing vehicle ids and model ids.
Reply
#6

pawn Код:
if(strcmp(cmd, "/car", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
      tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_DGOLD, "KORISTENJE: /car [ID/DioImena]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 3)
            {
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                    CreateVehicle(giveplayerid, 424, 2, 2);    
                    PutPlayerInVehicle(giveplayerid, 424, 0);
                        return 1;
                    }
                }//not connected
            }
            else
            {
                format(string, sizeof(string), "ERROR: Igrac %s nije aktivan igrac. Pokusajte kasnje opet.", giveplayerid);
                SendClientMessage(playerid, COLOR_LIGHTRED, string);
            }
        }
        return 1;
    }
Is this right ?
Reply
#7

Please can anyone help me.

When I type /car [ID/Name], dothing happens.

I give CreateCar, but 4 Warnings, problem ?

And sorry really for DP. !
Reply
#8

I will not that the car spawn on a Cordinate: CreateVehicle(424, .....)

I go somewhere and type /car [id/name] and it spawn
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)