public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/tele", true) == 0)
{
// FUNCOES
for(new i, p = GetMaxPlayers(); p < GetMaxPlayers(); i ++)
{
if(i == playerid || !IsPlayerInVehicle(i, GetPlayerVehicleID(playerid))) continue;
PutPlayerInVehicle(i, GetPlayerVehicleID(i), GetPlayerVehicleSeat(i));
}
return 1;
}
return 0;
}
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid,COR,"So drivers eque podem!");
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;
}
Teste, nгo se vai funcionar, mas acho que sim:
PHP код:
|
for(new i, p = GetMaxPlayers(); p < GetMaxPlayers(); i ++)
for(new i = 0, p = GetMaxPlayers(); i < p; i++)
if (!strcmp(cmdtext, "/tele", true))
{
if (GetPlayerVehicleSeat(playerid) > 0 || GetPlayerVehicleSeat(playerid) == -1)
{
SetPlayerPos(X, Y, Z);
return SendClientMessage(playerid, -1, "Vocк foi teleportado!");
}
SetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z);
return SendClientMessage(playerid, -1, "Vocк e seu veнculo foram teleportados!");
}