CMD:respawnallc(playerid, params[]) { #pragma unused params if(pInfo[playerid][Adminlevel] < 4)return SendClientMessage(playerid,COLOR_RED,"[ERROR]{FFFFFF} You don't have an appropriate administration level to use this command."); { new bool:vehicleused[MAX_VEHICLES]; for(new i=0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i)) { vehicleused[GetPlayerVehicleID(i)] = true; } } for(new i=1; i < MAX_VEHICLES; i++) { if(!vehicleused[i]) { SetVehicleToRespawn(i); } } new msg[128], pName[MAX_PLAYERS]; GetPlayerName(playerid, pName, sizeof(pName)); format(msg, sizeof(msg), "[ADMIN]{FFFFFF} %s has respawned all unused vehicles.", pName); SendClientMessageToAll(COLOR_ADMIN, msg); } return 1; }
CMD:veh(playerid,params[]) { if(pInfo[playerid][Adminlevel] < 1)return SendClientMessage(playerid,COLOR_RED,"[ERROR]{FFFFFF} You don't have an appropriate administration level to use this command."); { new car; new string[128]; new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, Float:X, Float:Y, Float:Z); if(sscanf(params,"i", car)) return SendClientMessage(playerid,0xff0000ff,"USAGE: /Veh <Vehicle ID 400 - 611>"); else if(car < 400 || car >611) return SendClientMessage(playerid, 0xff0000ff, "ERROR: Cannot go under 400 or above 611."); { if(Vehicle[playerid] != 0) { DestroyVehicle(Vehicle[playerid]); } Vehicle[playerid] = CreateVehicle(car, X, Y, Z + 2.0, 0, -1, -1, 1); format(string,sizeof(string),"You Have Spawned Vehicle ID %i",car); SendClientMessage(playerid, 0xffffffff, string); PutPlayerInVehicle(playerid, Vehicle[playerid], 0); } } return 1; }
CMD:respawnallc(playerid, params[])
{
#pragma unused params
if(pInfo[playerid][Adminlevel] < 4)return SendClientMessage(playerid,COLOR_RED,"[ERROR]{FFFFFF} You don't have an appropriate administration level to use this command.");
{
new bool:vehicleused[MAX_VEHICLES];
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
{
vehicleused[GetPlayerVehicleID(i)] = true;
}
}
for(new i=1; i < MAX_VEHICLES; i++)
{
if(!vehicleused[i])
{
SetVehicleToRespawn(i);
}
}
if(Vehicle[playerid] != 0)
{
DestroyVehicle(Vehicle[playerid]);
}
new msg[128], pName[MAX_PLAYERS];
GetPlayerName(playerid, pName, sizeof(pName));
format(msg, sizeof(msg), "[ADMIN]{FFFFFF} %s has respawned all unused vehicles.", pName);
SendClientMessageToAll(COLOR_ADMIN, msg);
}
return 1;
}
pawn Код:
|
CMD:veh(playerid,params[])
{
if(pInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF} You don't have an appropriate administration level to use this command.");
new car;
if(sscanf(params,"i", car)) return SendClientMessage(playerid,0xff0000ff,"USAGE: /Veh <Vehicle ID 400 - 611>");
if(car < 400 || car > 611) return SendClientMessage(playerid, 0xff0000ff, "ERROR: Cannot go under 400 or above 611.");
new string[128], Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
if(Vehicle[playerid] != INVALID_VEHICLE_ID) DestroyVehicle(Vehicle[playerid]);
Vehicle[playerid] = CreateVehicle(car, X, Y, Z + 2.0, 0, -1, -1, 1);
format(string,sizeof(string),"You Have Spawned Vehicle ID %i",car);
SendClientMessage(playerid, 0xffffffff, string);
PutPlayerInVehicle(playerid, Vehicle[playerid], 0);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(Vehicle[playerid] != INVALID_VEHICLE_ID)
{
DestroyVehicle(Vehicle[playerid]);
Vehicle[playerid] = INVALID_VEHICLE_ID;
}
return 1;
}
public OnPlayerConnect(playerid)
{
Vehicle[playerid] = INVALID_VEHICLE_ID;
return 1;
}
CMD:respawnallc(playerid, params[])
{
#pragma unused params
if(pInfo[playerid][Adminlevel] < 4) return SendClientMessage(playerid,COLOR_RED,"[ERROR]{FFFFFF} You don't have an appropriate administration level to use this command.");
new bool:vehicleused[MAX_VEHICLES], i;
for(i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(Vehicle[i] != INVALID_VEHICLE_ID)
{
DestroyVehicle(Vehicle[i]);
Vehicle[i] = INVALID_VEHICLE_ID;
}
if(!IsPlayerInAnyVehicle(i)) continue;
vehicleused[GetPlayerVehicleID(i)] = true;
}
for(i = 0; i < MAX_VEHICLES; i++)
{
if(vehicleused[i] == true) continue;
SetVehicleToRespawn(i);
}
new msg[80], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(msg, sizeof(msg), "[ADMIN]{FFFFFF} %s has respawned all unused vehicles.", pName);
SendClientMessageToAll(COLOR_ADMIN, msg);
return 1;
}