pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/makeevent", cmdtext, true, 10) == 0)
{
new pName[MAX_PLAYER_NAME],str[100];
GetPlayerName(playerid,pName,sizeof(pName));
SetPlayerPos(playerid, 1798.2366,-1303.9529,120.2656);
ResetPlayerWeapons(playerid);
format(str,sizeof(str),"{FF7F00}%s has made a event, type /joinevent to join the event.",pName);
SendClientMessageToAll(-1,str);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 24, 200);
SetPlayerArmour(playerid, 100);
return 1;
}
if (strcmp("/startevent", cmdtext, true, 10) ==0)
{
new pName[MAX_PLAYER_NAME], str[100];
GetPlayerName(playerid,pName,sizeof(pName));
Event[playerid] = 1;
SetPlayerPos(playerid, 1798.2366,-1303.9529,120.2656);
format(str,sizeof(str),"{FF7F00}%s has just started the event, it's now to late to join it.",pName);
SendClientMessageToAll(-1,str);
for(new v, b = GetMaxPlayers(); v != b; v++)
if(Event[v])
TogglePlayerControllable(v,true);
return 1;
}
if (strcmp("/joinevent", cmdtext, true, 10) ==0)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
if(Event[playerid] == 1) return SendClientMessage(playerid,-1,"{FF7F00}Error: You are already in the event.");
Event[playerid] = 1;
SetPlayerPos(playerid, 1798.2366,-1303.9529,120.2656);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 24, 200);
SetPlayerArmour(playerid, 100);
TogglePlayerControllable(playerid,false);
return 1;
}
if (strcmp("/leaveevent", cmdtext, true, 10) ==0)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
if(Event[playerid] == 0) return SendClientMessage(playerid,-1,"{FF7F00}Error: You are not in a event!");
Event[playerid] = 0;
SpawnPlayer(playerid);
TogglePlayerControllable(playerid,true);
return 1;
}
if (strcmp("/afk", cmdtext, true, 10) ==0)
{
new pName[MAX_PLAYER_NAME],str[100];
GetPlayerName(playerid,pName,sizeof(pName));
if(PlayerAFK[playerid] == 1) return SendClientMessage(playerid,-1,"{FF7F00}Error: You are already afk.");
PlayerAFK[playerid] = 1;
SetPlayerPos(playerid, 1798.2366,-1303.9529,120.2656);
ResetPlayerWeapons(playerid);
format(str,sizeof(str),"{FF7F00} %s went to the AFK room (/afk).",pName);
SendClientMessageToAll(-1,str);
return 1;
}
if (strcmp("/back", cmdtext, true, 10) ==0)
{
new pName[MAX_PLAYER_NAME],str[100];
GetPlayerName(playerid,pName,sizeof(pName));
format(str,sizeof(str),"{FF7F00} %s just left the AFK room (/back).",pName);
if(PlayerAFK[playerid] == 0) return SendClientMessage(playerid,-1,"{FF7F00}Error: You are not AFK");
PlayerAFK[playerid] = 0;
SpawnPlayer(playerid);
SendClientMessageToAll(-1,str);
return 1;
}
if (strcmp("/af", cmdtext, true, 10) == 0)
{
SetTimer("Teleport", 5000, false);
new pName[MAX_PLAYER_NAME],str[100];
GetPlayerName(playerid,pName,sizeof(pName));
format(str,sizeof(str),"{FF7F00} %s went to the Abonded Airfield (/af).",pName);
SetPlayerPos(playerid, 431.0490,2503.5349,16.4844);
SendClientMessageToAll(-1,str);
return 1;
}
if (strcmp("/mount", cmdtext, true, 10) == 0)
{
new pName[MAX_PLAYER_NAME],str[100];
GetPlayerName(playerid,pName,sizeof(pName));
format(str,sizeof(str),"{FF7F00} %s went to Mount Chilliad (/mount).",pName);
SetPlayerPos(playerid, -2308.1533,-1657.3539,483.6814);
SendClientMessageToAll(-1,str);
return 1;
}
if (strcmp("/cinfo", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, GREEN , "Leaders:{FFFFFF}[qK]Founder,[qK]Santoz");
SendClientMessage(playerid, GREEN , "Co-Leader:{FFFFFF} None");
SendClientMessage(playerid, GREEN , "Member Manager:{FFFFFF}[qK]Smog");
SendClientMessage(playerid, GREEN , "Veteran:{FFFFFF} None");
SendClientMessage(playerid, GREEN , "Full Member:{FFFFFF}[qK]Nothing2lose,[qK]Charlie_Rouse,[qK]Student66,[qK]Lamalord,[qK]Don_Invisible,[qK]King,[qK]_Joker_2");
SendClientMessage(playerid, GREEN , "Trial Member:{FFFFFF}[qK]Proz");
return 1;
}
if (strcmp("/help", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, -1, "{0DF014}|_________________________{FFFFFF}Help{0DF014}_________________________|");
SendClientMessage(playerid, -1, "{0DF014}Commands:{FFFFFF} /admins, /cinfo, /kill, /heal, /armour, /shop");
SendClientMessage(playerid, -1, "{0DF014}Commands:{FFFFFF} /repair, /afk, /back, /fun");
SendClientMessage(playerid, -1, "{0DF014}Account:{FFFFFF} /register, /login, /rules, /changeteam, /credits");
SendClientMessage(playerid, COLOR_WHITE, "|_______________________________________________________|");
return 1;
}
if (strcmp("/rules", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, GREEN , "Don't carpark");
SendClientMessage(playerid, GREEN , "Don't heliblade");
SendClientMessage(playerid, GREEN , "Do not C-bug under any conditions!");
SendClientMessage(playerid, GREEN , "Do not disrespect or direct flame any player here.");
return 1;
}
if (strcmp("/heal", cmdtext, true, 10) == 0)
{
if(IsPlayerCloseToEnemy(playerid)) return SendClientMessage(playerid, COLOR_ORANGE, "You are to close to your enemies to refill your health.");
if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, COLOR_ORANGE, "You don't have enough money to purchase health.");
GivePlayerMoney(playerid, -1000);
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, GREEN, "You have refilled your health but lost 1000.");
return true;
}
if (strcmp("/armour", cmdtext, true, 10) == 0)
{
if(IsPlayerCloseToEnemy(playerid)) return SendClientMessage(playerid, COLOR_ORANGE, "You are to close to your enemies to refill your armour.");
if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, COLOR_ORANGE, "You don't have enough money to purchase armour.");
GivePlayerMoney(playerid, -2000);
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid, GREEN, "You have refilled your armour but lost 2000.");
return true;
}
if (strcmp("/kill", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid,0.0);
SendClientMessage(playerid, COLOR_ORANGE, "You have commited suicide!");
return 1;
}
if (strcmp("/repair", cmdtext, true, 10) == 0)
{
if(IsPlayerCloseToEnemy(playerid))return SendClientMessage(playerid, COLOR_ORANGE, "You are to close to your enemies to repair your vehicle.");
if(GetPlayerMoney(playerid) < 2500) return SendClientMessage(playerid, COLOR_ORANGE, "You don't have enough money to repair your vehicle.");
if (IsPlayerInAnyVehicle(playerid)) {
new VehicleID = GetPlayerVehicleID(playerid); SetVehicleHealth(VehicleID,1000.0);
SendClientMessage(playerid,GREEN,"You have repaired your vehicle but lost 2500.");
GivePlayerMoney(playerid, -2500);
} else {
SendClientMessage(playerid,COLOR_ORANGE,"Error: You are not in a vehicle"); }
return true;
}
if (strcmp("/credits", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, GREEN, "Credits:{FFFFFF} Leroy_ - Main Management");
SendClientMessage(playerid, GREEN, "Credits:{FFFFFF} Saad - Main Scripter");
SendClientMessage(playerid, GREEN, "Credits:{FFFFFF} Santoz - Scripter");
return 1;
}
if (strcmp("/changeteam", cmdtext, true, 10) == 0)
{
ForceClassSelection(playerid);
SetPlayerHealth(playerid, 0);
return 1;
}
if (strcmp("/fun", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, GREEN, "Teleports:{FFFFFF} /af (Abonded Airfield)");
SendClientMessage(playerid, GREEN, "Teleports:{FFFFFF} /mount (Mount Chilliad)");
SendClientMessage(playerid, GREEN, "Teleports:{FFFFFF} /afk (AFK Room)");
SendClientMessage(playerid, GREEN, "Teleports:{FFFFFF} /back (Back from AFK)");
return 1;
}
if (strcmp("/shop", cmdtext, true, 10) == 0)
{
if(IsPlayerCloseToEnemy(playerid)) return SendClientMessage(playerid, COLOR_ORANGE, "You are to close to your enemies to buy anything in the shop.");
ShowPlayerDialog(playerid, SHOP, DIALOG_STYLE_LIST, "Shop", "9mm - $200\nSilenced Pistol - $1000\nDesert Eagle - $1500\nMP5 - $1500\nShotgun - 1500\nCombat Shotgun - $3500\nAK-47 - $4500\nM4 - $5000\nSniper Rifle - 4500","Buy","Cancel");
return true;
}
// - - Admin Commands - - //
return SendClientMessage(playerid, GREEN, "[SAMP TDM] That command does not exist, please use /help for more information.");
}