19.03.2016, 16:23
Hello,
I've been trying to make a few commands for my server but it seems to not been working. The first command allows admins to lock/unlock vehicles by their IDs.
Problem with it is that it doesn't work.
Problem 2
This command restricts administrators from deleting server cars but only allowing them to delete spawned cars. Also, I've been trying to implement a similar thing into a respawn car command (Respawns server cars but deletes spawned cars).
This is in my delete car command
This is in my respawn cars command.
Help would be appreciated.
Thanks
I've been trying to make a few commands for my server but it seems to not been working. The first command allows admins to lock/unlock vehicles by their IDs.
Код:
CMD:alock(playerid, params[]) { if( pInfo[playerid][pAdmin] < 1 ) return 0; new vehicleid; if( sscanf(params, "u", vehicleid )) return SendUsageError( playerid, "/alock [Vehicle ID]" ); SendClientMessage(playerid, 0xBF60FFFF, "You have locked the doors on this vehicle"); for(new i=0; i < MAX_PLAYERS; i++) { if(i == playerid) continue; SetVehicleParamsForPlayer(vehicleid, i, 0, 1); } return 1; }
Problem 2
This command restricts administrators from deleting server cars but only allowing them to delete spawned cars. Also, I've been trying to implement a similar thing into a respawn car command (Respawns server cars but deletes spawned cars).
Код:
new spawnedcar;
Код:
stock CreateVehicleEx(playerid, modelid) { new world = GetPlayerVirtualWorld(playerid), interior = GetPlayerInterior(playerid), Float:x, Float:y, Float:z, Float:a; GetPlayerPos(playerid, x,y,z); GetPlayerFacingAngle(playerid, a); spawnedcar = CreateVehicle(modelid, x+3,y,z, a, -1, -1, -1); LinkVehicleToInterior(spawnedcar, interior); SetVehicleVirtualWorld(spawnedcar, world); PutPlayerInVehicle(playerid, spawnedcar, 0); SetPlayerInterior(playerid, interior); return 1; }
Код:
if( GetPlayerVehicleID( playerid ) != spawnedcar ) return Error(playerid, "You can only delete spawned vehicles");
Код:
DestroyVehicle(spawnedcar);
Thanks