04.08.2011, 13:02
pawn Код:
if (!strcmp("/meuteleportecomveiculo", cmdtext, true))
{
new vehicleid = GetPlayerVehicleID(playerid);
if(!IsValidVehicle(vehicleid)) return SendClientMessage(playerid, -1, "Vocк precisa de um veнculo para ir ao local.");
switch(GetPlayerState(playerid))
{
case PLAYER_STATE_DRIVER:
{
SetVehiclePos(vehicleid, 0.0, 0.0, 0.0);
}
case PLAYER_STATE_PASSENGER:
{
for(new i = 0, j = GetMaxPlayers(); i < j; i++)
{
if(GetPlayerVehicleID(i) == vehicleid && GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
return SendClientMessage(playerid, -1, "Vocк nгo pode se teleportar com o carro quando hб um motorista nele.");
}
}
SetVehiclePos(vehicleid, 0.0, 0.0, 0.0);
}
}
return 1;
}