Car -
Edin Black - 02.06.2012
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;
}
Re: Car -
Rayelm - 02.06.2012
change this line
pawn Код:
PutPlayerInVehicle(playerid, 424, 0);
with
pawn Код:
PutPlayerInVehicle(giveplayerid, 424, 0);
Re: Car -
Edin Black - 02.06.2012
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.
Re: Car -
Rayelm - 02.06.2012
are your admin level is 3 ?
Re: Car -
Yuryfury - 02.06.2012
You have to CreateVehicle first, Get the vehicle id, then do PutPlayerInVehicle(playerid,vehicleid,0).
You are confusing vehicle ids and model ids.
Re: Car -
Edin Black - 02.06.2012
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 ?
Re: Car -
Edin Black - 02.06.2012
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. !
Re: Car -
Edin Black - 02.06.2012
I will not that the car spawn on a Cordinate: CreateVehicle(424, .....)
I go somewhere and type /car [id/name] and it spawn