11.06.2014, 23:11
I created a racing event wanted each player to be placed on a vehicle that is not occupied tried to do but not have the right time that the player and set on a vehicle that is already occupied.
pawn Код:
new Carro[20];
if(dialogid == 666)
{
if(response == 0)
{
SendClientMessage(playerid, COR_RED, "You chose to go on the Event!");
TrazerKart[playerid] = 0;
return 1;
}
if(response == 1)
{
if(PlayerInfo[playerid][pJailed] != 0)
{
SendClientMessage(playerid,COR_RED,"ERRO* you are stuck and can not go to the Event!");
TrazerKart[playerid] = 0;
return 0;
}
new tmp[128];
new plo, world;
plo = ReturnUser(tmp);
world = GetPlayerVirtualWorld(playerid);
new tmpcar = GetPlayerVehicleID(playerid);
SetPlayerVirtualWorld(plo,world);
RemovePlayerFromVehicle(tmpcar);
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
SetPlayerVirtualWorld(plo,world);
ResetPlayerWeaponsEx(playerid);
PlayerInfo[playerid][pTrazerKart] = 1;
SendClientMessage(playerid,COR_RED,"Welcome to the event!");
for(new i=0; i<MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pTrazerKart] == 1)
{
if(!IsPlayerInVehicle(i, Carro[random(20)]))
{
SetPlayerInterior(i,0);
PutPlayerInVehicle(i, Carro[random(20)], 0);
Jogadoreskart++;
EVENTO[i] = 1;
SetPlayerRaceCheckpoint(i,1,-1341.8914,-671.3342,1055.9453,0.0,0.0,0.0,10.0);
}
}
}
}
return 1;
}