03.09.2013, 00:29
Hi guys, i've got a RP and this script is giving me headaches.
Is there any way to make it simply just for admins??
like this.
but ofc that one doesnt work for me, because is made for a different gm, could someone adapt that "zcmd (apark" for my gm? thank you in advance.
PHP код:
CMD:estacionar(playerid, params[])
{
if(Info[playerid][pVehicleKeysFrom] != INVALID_PLAYER_ID)
{
new ownerid = Info[playerid][pVehicleKeysFrom];
if(IsPlayerConnected(ownerid))
{
new d = Info[playerid][pVehicleKeys];
if(IsPlayerInVehicle(playerid, PlayerVehicleInfo[ownerid][d][pvId]))
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessageEx(playerid, COLOR_GREY, "Tu debes ser el conductor.");
new Float:x, Float:y, Float:z, Float:angle, Float:health;
GetVehicleHealth(PlayerVehicleInfo[ownerid][d][pvId], health);
PlayerVehicleInfo[ownerid][d][pvHealth] = health;
//if(health < 800) return SendClientMessageEx(playerid, COLOR_GREY, " Tu vehнculo estб demasiado daсado para estacionarlo.");
if(Info[playerid][pLockCar] == GetPlayerVehicleID(playerid)) Info[playerid][pLockCar] = INVALID_VEHICLE_ID;
GetVehiclePos(PlayerVehicleInfo[ownerid][d][pvId], x, y, z);
GetVehicleZAngle(PlayerVehicleInfo[ownerid][d][pvId], angle);
SurfingCheck(GetPlayerVehicleID(playerid));
UpdatePlayerVehicleParkPosition(ownerid, d, x, y, z, angle, health);
PutPlayerInVehicle(playerid, GetPlayerVehicleID(playerid), 0);
SetPlayerArmedWeapon(playerid, 0);
new string[29 + (MAX_PLAYER_NAME * 2)];
format(string, sizeof(string), "* %s ha estacionado el vehiculo de %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(ownerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
fVehSpeed[playerid] = 0.0;
return 1;
}
}
}
for(new d = 0 ; d < MAX_PLAYERVEHICLES; d++)
{
if(IsPlayerInVehicle(playerid, PlayerVehicleInfo[playerid][d][pvId]))
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessageEx(playerid, COLOR_GREY, "Tu debes ser el conductor.");
new Float:x, Float:y, Float:z, Float:angle, Float:health;
GetVehicleHealth(PlayerVehicleInfo[playerid][d][pvId], health);
PlayerVehicleInfo[playerid][d][pvHealth] = health;
//if(health < 800) return SendClientMessageEx(playerid, COLOR_GREY, " Tu vehiculo estб muy daсado para estacionarlo.");
if(Info[playerid][pLockCar] == GetPlayerVehicleID(playerid)) Info[playerid][pLockCar] = INVALID_VEHICLE_ID;
GetVehiclePos(PlayerVehicleInfo[playerid][d][pvId], x, y, z);
GetVehicleZAngle(PlayerVehicleInfo[playerid][d][pvId], angle);
SurfingCheck(GetPlayerVehicleID(playerid));
UpdatePlayerVehicleParkPosition(playerid, d, x, y, z, angle, health);
PutPlayerInVehicle(playerid, PlayerVehicleInfo[playerid][d][pvId], 0);
SetPlayerArmedWeapon(playerid, 0);
new string[30 + (MAX_PLAYER_NAME * 2)];
format(string, sizeof(string), "* %s ha estacionado su vehiculo.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
fVehSpeed[playerid] = 0.0;
return 1;
}
}
SendClientMessageEx(playerid, COLOR_GREY, "Tu necesitas estar dentro de tu vehiculo para hacer esto.");
return 1;
}
like this.
PHP код:
zcmd(apark, playerid, params[])
{
new Float:x,Float:y,Float:z,Float:a;
if(PlayerInfo[playerid][pJDS] >= 1)
{
new idcar = GetPlayerVehicleID(playerid);
GetVehiclePos(idcar, x, y, z); GetVehicleZAngle(idcar, a);
CarInfo[idcar][cLocationx] = x;
CarInfo[idcar][cLocationy] = y;
CarInfo[idcar][cLocationz] = z;
CarInfo[idcar][cAngle] = a;
Message(playerid, COLOR_GRAD2, " Nuevas coordenadas guardadas. ЎAhora el vehнculo aparecerб aqui!");
} else Message(playerid, COLOR_GRAD2, "ЎNo autorizado!");
return 1;
}