29.08.2014, 12:42
Here i did but its not working again e.e
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/changeclass", cmdtext, true))
{
SPD(playerid,3,DSL,"{FFFFFF}Change your class","Sniper ~ 20 Kills\nEnginner ~ 100 Kills\nSoldier ~ 50 Kills\nRookie ~ 0 Kills","Select","Exit");
return 1;
}
if (strcmp("/changeteam", cmdtext, true))
{
SPD(playerid,5,DSL,"{FFFFFF}Select your team","{0000FF}Ukraine\n{FF0000}Russia","Select","");
return 1;
}
if (strcmp("/kill", cmdtext, true))
{
SetPlayerHealth(playerid,0);
return 1;
}
if (strcmp("/armour", cmdtext, true))
{
if(GetPlayerMoney(playerid) <10000) return SendClientMessage(playerid,0xAA3333AA, "[SERVER]:You need 10000$ to use this command");
GivePlayerMoney(playerid,-10000);
SetPlayerArmour(playerid,100);
SendClientMessage(playerid,COLOR_YELLOW,"[SERVER]:You have been armoured 10000$ have been taken from your account.");
return 1;
}
if (strcmp("/health", cmdtext, true))
{
if(GetPlayerMoney(playerid) <10000) return SendClientMessage(playerid,0xAA3333AA, "[SERVER]:You need 10000$ to use this command");
GivePlayerMoney(playerid,-10000);
SetPlayerHealth(playerid,100);
SendClientMessage(playerid,COLOR_YELLOW,"[SERVER]:You have been healed 10000$ have been taken from your account.");
return 1;
}
if (strcmp("/clearanims", cmdtext, true))
{
ClearAnimations(playerid);
return 1;
}
if (strcmp("/dance", cmdtext, true))
{
SetPlayerSpecialAction(playerid, 5);
SendClientMessage(playerid, COLOR_YELLOW , "[SERVER]:You are dancing.");
return 1;
}
if (strcmp("/handsup", cmdtext, true))
{
SetPlayerSpecialAction(playerid, 10);
SendClientMessage(playerid, COLOR_YELLOW , "[SERVER]:Your hands are up.");
return 1;
}
if (strcmp("/jetpack", cmdtext, true))
{
if(Player[playerid][pAdmin] >= 1)
{
SetPlayerSpecialAction(playerid, 2);
SendClientMessage(playerid, COLOR_YELLOW , "[SERVER]:JetPack spawned.");
}
else
{
SendClientMessage(playerid,COLOR_RED,"[SERVER]:You are not allowed to use this command.");
}
return 1;
}
if (strcmp("/night", cmdtext, true))
{
SetPlayerTime(playerid,23,50);
return 1;
}
if (strcmp("/day", cmdtext, true))
{
SetPlayerTime(playerid,6,55);
return 1;
}
if (strcmp("/ep", cmdtext, true))
{
GivePlayerWeapon(playerid, 46, 1);
SendClientMessage(playerid, COLOR_YELLOW , "[SERVER]:Emergency Parachute spawned");
return 1;
}
if (strcmp("/adminrefill", cmdtext, true))
{
if(Player[playerid][pAdmin] >= 1)
{
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid, COLOR_YELLOW , "[SERVER]:You restored your health and armour");
}
else
{
SendClientMessage(playerid, COLOR_YELLOW , "[SERVER]:You are not allowed to use this command");
}
return 1;
}
if (strcmp("/onduty", cmdtext, true))
{
if(Player[playerid][pAdmin] >= 1)
{
SetPlayerHealth(playerid, 999999);
SetPlayerArmour(playerid, 999999);
SendClientMessage(playerid, COLOR_YELLOW , "[SERVER]:You are now admin onduty");
SetPlayerColor(playerid, COLOR_PINK);
SetPlayerSkin(playerid, 217);
GivePlayerWeapon(playerid, 38 , 999999);
}
else
{
SendClientMessage(playerid, COLOR_RED , "[SERVER]:You are not allowed to use this command");
}
return 1;
}
if (strcmp("/ukrainebase", cmdtext, true))
{
if(Player[playerid][pAdmin] >= 1)
{
SetPlayerPos(playerid,-250.8406,2598.8433,62.8582);
SendClientMessage(playerid,COLOR_YELLOW,"[SERVER]:You teleported to Ukraine Base");
}
else
{
SendClientMessage(playerid, COLOR_RED , "[SERVER]:You are not allowed to use this command");
}
return 1;
}
if (strcmp("/russiabase", cmdtext, true))
{
if(Player[playerid][pAdmin] >= 1)
{
SetPlayerPos(playerid,-149.9057,1079.6403,19.7422);
SendClientMessage(playerid,COLOR_YELLOW,"[SERVER]:You teleported to Russia Base");
}
else
{
SendClientMessage(playerid, COLOR_RED , "[SERVER]:You are not allowed to use this command");
}
return 1;
}
if (strcmp("/duel", cmdtext, true))
{
SetPlayerInterior(playerid,10);
SetPlayerColor(playerid,COLOR_YELLOW);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,31,99999);
GivePlayerWeapon(playerid,27,99999);
GivePlayerWeapon(playerid,24,99999);
SetPlayerPos(playerid,-975.975708,1060.983032,1345.671875);
GameTextForPlayer(playerid,"~b~Welcome to ~r~Duel", 5000, 1);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SetPlayerSkin(playerid,73);
return 1;
}
if (strcmp("/duel1", cmdtext, true))
{
SetPlayerInterior(playerid,10);
SetPlayerColor(playerid,COLOR_GREEN);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,31,99999);
GivePlayerWeapon(playerid,27,99999);
GivePlayerWeapon(playerid,24,99999);
SetPlayerPos(playerid,-1130.9126,1057.6101,1346.4174);
GameTextForPlayer(playerid,"~b~Welcome to ~r~Duel", 5000, 1);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SetPlayerSkin(playerid,287);
return 1;
}
if (strcmp("/skin", cmdtext))
{
if(Player[playerid][pAdmin] >= 1)
{
SetPlayerSkin(playerid,23);
SendClientMessage(playerid,COLOR_YELLOW,"[SERVER]:You have changed your skin to id 23.");
}
else
{
SendClientMessage(playerid, COLOR_RED,"[SERVER]:You are not allowed to use this command.");
}
return 1;
}
if (strcmp("/skin1", cmdtext, true))
{
if(Player[playerid][pAdmin] >= 1)
{
SendClientMessage(playerid,COLOR_YELLOW,"[SERVER]:You have changed your skin to id 29.");
SetPlayerSkin(playerid,29);
}
else
{
SendClientMessage(playerid, COLOR_RED,"[SERVER]:You are not allowed to use this command.");
}
return 1;
}
if (strcmp("/getcar", cmdtext, true))
{
if(Player[playerid][pAdmin] >= 1)
{
new Float:X;
new Float:Y;
new Float:Z;
GetPlayerPos(playerid,X,Y,Z);
CreateVehicle(411,X,Y+5,Z,1,126,126,9000);
SendClientMessage(playerid,COLOR_YELLOW,"[SERVER]:You spawned a Infernus");
}
else
{
SendClientMessage(playerid,COLOR_RED, "[SERVER]:You are not allowed to use this command.");
}
return 1;
}
if (strcmp("/getbike", cmdtext, true))
{
if(Player[playerid][pAdmin] >= 1)
{
new Float:X;
new Float:Y;
new Float:Z;
GetPlayerPos(playerid,X,Y,Z);
CreateVehicle(522,X,Y+5,Z,1,126,126,9000);
SendClientMessage(playerid,COLOR_YELLOW,"[SERVER]:You spawned a NRG-500");
}
else
{
SendClientMessage(playerid,COLOR_RED, "[SERVER]:You are not allowed to use this command.");
}
return 1;
}
if (strcmp("/getplane", cmdtext, true))
{
if(Player[playerid][pAdmin] >= 1)
{
new Float:X;
new Float:Y;
new Float:Z;
GetPlayerPos(playerid,X,Y,Z);
CreateVehicle(520,X,Y+10,Z,1,126,126,9000);
SendClientMessage(playerid,COLOR_YELLOW,"[SERVER]:You spawned a Hydra");
}
else
{
SendClientMessage(playerid,COLOR_RED, "[SERVER]:You are not allowed to use this command.");
}
return 1;
}
if (strcmp("/flip", cmdtext, true))
{
if(Player[playerid] [pAdmin] >=1)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid;
new Float:angle;
vehicleid= GetPlayerVehicleID(playerid);
GetVehicleZAngle(vehicleid,angle);
SetVehicleZAngle(vehicleid,angle);
SendClientMessage(playerid,COLOR_YELLOW,"[SERVER]:Your vehicle has been fliped.");
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"[SERVER]:You need to be inside a car to use this command");
}
}
else
{
SendClientMessage(playerid,COLOR_RED,"[SERVER]:You are not allowed to use this command.");
}
return 1;
}
if (strcmp("/tune", cmdtext, true))
{
if(Player[playerid] [pAdmin] >=1)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid;
vehicleid= GetPlayerVehicleID(playerid);
RemoveVehicleComponent(vehicleid,1010);
RemoveVehicleComponent(vehicleid,1000);
RemoveVehicleComponent(vehicleid,1087);
SetVehicleNumberPlate(vehicleid,"VIP1377");
AddVehicleComponent(vehicleid,1010);
AddVehicleComponent(vehicleid,1000);
AddVehicleComponent(vehicleid,1087);
SendClientMessage(playerid,COLOR_YELLOW,"[SERVER]:Your vehicle has been tuned.");
}
else
{
SendClientMessage(playerid,COLOR_RED,"[SERVER]:You need to be inside a car to use this command.");
}
}
else
{
SendClientMessage(playerid,COLOR_RED, "[SERVER]:You are not allowed to use this command.");
}
}
if (strcmp("/respawncar", cmdtext, true))
{
if(Player[playerid] [pAdmin] >=1)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid;
vehicleid= GetPlayerVehicleID(playerid);
SetVehicleToRespawn(vehicleid);
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"[SERVER]:You need to be inside a car to use this command");
}
}
else
{
SendClientMessage(playerid,COLOR_RED,"[SERVER]:You are not allowed to use this command.");
}
return 1;
}
if (strcmp("/destroycar", cmdtext, true))
{
if(Player[playerid] [pAdmin] >=1)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid;
vehicleid= GetPlayerVehicleID(playerid);
DestroyVehicle(vehicleid);
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"[SERVER]:You need to be inside a car to use this command");
}
}
else
{
SendClientMessage(playerid,COLOR_RED, "[SERVER]:You are not allowed to use this command.");
}
return 1;
}
if (strcmp("/fix", cmdtext, true))
{
if(Player[playerid][pAdmin] >= 1)
{
if(IsPlayerInAnyVehicle(playerid))
{
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid,COLOR_RED,"[SERVER]:You have repaired your vehicle");
}
else
{
SendClientMessage(playerid, COLOR_RED,"[SERVER]:You are not driving any car");
}
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"[SERVER]:You are not allowed to use this command");
}
return 1;
}
if (strcmp("/restart", cmdtext, true))
{
if(Player[playerid][pAdmin] >= 1)
{
SendClientMessageToAll(COLOR_YELLOW,"[SERVER]:Server is restarting be patient do not quit please");
GameTextForAll("~G~Server Restarting", 9000, 1);
SendRconCommand("gmx");
}
else
{
SendClientMessage(playerid, COLOR_RED, "[SERVER]:You are not allowed to use this command");
}
return 1;
}
if (strcmp("/desertairport", cmdtext, true))
{
if(Player[playerid][pAdmin] >= 1)
{
SetPlayerPos(playerid,392.2665,2535.1682,16.5429);
SendClientMessage(playerid,COLOR_YELLOW,"[SERVER]:You teleported to Desert Airport");
}
else
{
SendClientMessage(playerid, COLOR_RED , "[SERVER]:You are not allowed to use this command");
}
return 1;
}
return 0;
}