15.03.2014, 08:56
I do this command in the server and just nothing happens.
PHP код:
CMD:apark(playerid, params[]) {
if(PlayerInfo[playerid][pAdmin] >= 3)
{
if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
{
SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");
return 1;
}
foreach(Player, ownerid)
{
for(new d = 0 ; d < MAX_PLAYERVEHICLES; d++)
{
if(IsPlayerInVehicle(playerid, PlayerVehicleInfo[ownerid][d][pvId]))
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You must be in the driver seat.");
new Float:x, Float:y, Float:z, Float:angle, Float:health;
if(PlayerInfo[playerid][pLockCar] == GetPlayerVehicleID(playerid)) PlayerInfo[playerid][pLockCar] = INVALID_VEHICLE_ID;
if(IsARC(GetPlayerVehicleID(playerid))) // RC Vehicles
{
new Float:vehPos[3];
GetVehiclePos(GetPlayerVehicleID(playerid),vehPos[0], vehPos[1], vehPos[2]);
SetPlayerPos(playerid,vehPos[0], vehPos[1]+0.5, vehPos[2]+0.5);
}
GetVehicleHealth(PlayerVehicleInfo[ownerid][d][pvId], health);
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 szMessage[128];
format(szMessage, sizeof(szMessage),"You have parked %s's %s.",GetPlayerNameEx(ownerid), VehicleName[PlayerVehicleInfo[ownerid][d][pvModelId] - 400]);
SendClientMessage(playerid, COLOR_WHITE, szMessage);
format(szMessage, sizeof(szMessage), "Your %s has been parked at another location by an admin. Use /trackcar to find it.", VehicleName[PlayerVehicleInfo[ownerid][d][pvModelId] - 400]);
SendClientMessage(ownerid, COLOR_WHITE, szMessage);
return 1;
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
}
return 1;
}