Start With Wanted System
/// TIMERS
[pawn]SetTimer("DisplayWanted",1000*60*1,1);[/pawn]
public
[pawn]public DisplayWanted()
{
new Msg[256];
new xgv[256];
format(file, sizeof(file), "/Wanted/Wanted.ini");
xgv = dini_Get(file, "Wanted");
format(Msg,sizeof(Msg),"Wanted Player :%s",xgv);
SendClientMessageToAll(COLOR_YELLOW, Msg);
}[/pawn]
Now Step 2
Salute System
[pawn] else if ( strcmp( cmd, "salute", true ) == 0 )
{
new snick[ 128 ], plr, szMsg[ 128 ];
snick = strtok( cmdtext, idx ), plr = FindPlayerIDFromString( snick);
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else if ( !strlen(snick) ) SendClientMessage( playerid, COLOR_GREEN, "USAGE: /c salute [Nick/ID]" );
else if ( plr == INACTIVE_PLAYER_ID ) SendClientMessage( playerid, COLOR_RED, "Error: Unknown player" );
else
{
format( szMsg, sizeof( szMsg ), "%s salute player:[ %s ] As A Good Guy", gPlayers[ playerid ], gPlayers[ plr ] );
SendClientMessageToAll( COLOR_GREEN, szMsg );
format( szMsg, sizeof( szMsg ), "%s salute You", gPlayers[ plr ] );
SendClientMessage(plr, RED, szMsg );
}
return 1;
}[/pawn]
/// now lms
[pawn]enum LMSInfo
{
OnLMS,
LockLMS,
CountLMS,
Float:MinXS,
Float:MaxXS,
Float:MinYS,
Float:MaxYS,
Float:PosXS,
Float:PosYS,
Float:PosZS,
IntS,
RewS,
CDLMS,
WinnerS[256],
}[/pawn]
[pawn]new LMS1;[/pawn]
[pawn]new gLMS[LMSInfo];[/pawn]
[pawn]new Float:RandInfoLMS[15][7] = { // MinX, MaxX, MinY, MaxY , X , Y , Z , Interior
{-1102.2737,-1075.0229,1267.8066,1393.5516,-1094.28332519, 1307.67419433, 34.24106979},// Satelite del Estadio
{-1708.7883, -1540.6664, -524.5789, -463.3878, -1635.2369, -501.1630, 50.1828},// Arriba de un edificio en los Aviones cerca de la Militar.
{-1013.4427, -924.8788, 698.5222, 777.5504, -969.2894, 743.3184, 57.2507},// Ariba de un edifico cerca de la Pizzeria Downtown.
{-833.6387, -754.4878, 806.6534, 855.1415, -804.1165, 815.6527, 11.0846},//En un parquedero de autos atras de la Rstacion de Bomberos.
{542.0474, 590.8376, -110.5802, -70.8055, 568.1187, -84.2334, 9.4397},//aqui hay duda = Es en el tinaco grande que esta en Malibu.
{91.7778, 167.5648, 329.0602, 357.0180, 128.2160, 343.1032, 19.1541},// Este es en la cancha de Golf.
{-44.6020, -27.4109, 1178.2372, 1213.4877, -37.6370, 1197.8688, 21.4526},// Este es en la cancha de los ladrones cerca del Estudio.
{-1200.9607, -1167.4662, -1349.8386, -1312.9932, -1183.3875, -1334.0931, 14.9360}, // Este es en el Muelito cerca del Aeropuerto.
{-1107.7136, -1057.4801, -288.9542, -239.3820, -1081.9669, -262.2973, 20.4579}, // Arriba de la Imprenta
{-1107.7972, -1069.2410, -634.8514, -594.0654, -1090.0913, -616.2128, 11.2534}, // Cerca del Cafe Rubina
{-1003.6110, -955.4279, 96.3539, 142.3303, -978.6742, 119.9475, 9.2628}, // En las chositas de Little Heavana
{-998.5562, -902.6942, 369.7229, 427.0913, -954.6682, 397.8014, 11.2516}, // No se como se llama, pero lo conosco como secreto xD
{196.3628, 236.3812, -1297.0651, -1252.8628, 230.3235, -1266.7476, 20.1141}, //En el Suite de Tommy
{98.4118, 135.2352, -1340.5229, -1308.0060, 121.8333, -1328.8723, 4.4396}, // Cerca del Pole Position, es como Mini Centro
{-18.8285, 27.5851, -949.9951, -927.9282, 4.2093, -941.0284, 16.1160} // Es el Mercadito que esta cerca de un Hospital.
};
////////////////////////////////////////////////////////////////////////////////
new RandRewardLMS[10][1] = {
{500},
{1500},
{3000},
{4500},
{6000},
{7500},
{9000},
{12500},
{16000},
{25000}
};[/pawn]
[pawn] else if (strcmp(cmd, "!lms", true) == 0) {
if (IsPlayerInfo(playerid,cmd)) return 0;
else if(gLMS[OnLMS] == 1) MessagePM(playerid, GREEN,"[Error] - Last Man Standing currently activated.");
else {
StarLMS();
}
return 1;
}
else if (strcmp(cmd, "!join", true) == 0) {
if (IsPlayerInfo(playerid,cmd)) return 0;
else if(gLMS[OnLMS] == 0) MessagePM(playerid, GREEN,"[Error] - Last Man Standing currently disabled.");
else if(plInfo[playerid][JoinLMS] == 1) MessagePM(playerid, GREEN,"[Error] - You are already in Last Man Standing.");
else if(gLMS[LockLMS] == 1) MessagePM(playerid, GREEN,"[Error] - You can't enter the Last Man Standing.");
else {
JoinPlayerLMS(playerid);
}
return 1;
}[/pawn]
[pawn]//==============================================================================
//------------------------ FUNCTIONS TO LMS GAME -------------------------------
//==============================================================================
public StarLMS()
{
new rand1 = random(sizeof(RandInfoLMS)), rand2 = random(sizeof(RandRewardLMS));
new Float:x, Float:y, Float:z, Float:MinX, Float:MaxX, Float:MinY, Float:MaxY;
MinX = RandInfoLMS[rand1][0],MaxX = RandInfoLMS[rand1][1],MinY = RandInfoLMS[rand1][2],MaxY = RandInfoLMS[rand1][3];
x = RandInfoLMS[rand1][4],y = RandInfoLMS[rand1][5],z = RandInfoLMS[rand1][6];
gLMS[MinXS] = MinX, gLMS[MaxXS] = MaxX, gLMS[MinYS] = MinY, gLMS[MaxYS] = MaxY;
gLMS[PosXS] = x, gLMS[PosYS] = y, gLMS[PosZS] = z, gLMS[RewS] = RandRewardLMS[rand2][0], gLMS[OnLMS] = 1;
SetTimer("CloseJoinLMS",20000,0);
MessageAll(BLUE, "LMS Activate, type !join to enter, wait players [20 Seg.]");
return 1;
}
//==============================================================================
public JoinPlayerLMS(playerid)
{
new Float:x, Float:y, Float:z;
MessagePM(playerid, GREEN,"Joined to Last Man Standing, waiting more players...");
GetPlayerPos(playerid,x,y,z);
IncLMSCount(1);
TogglePlayerControllable(playerid,0);
ResetPlayerWeapons(playerid);
format(MSN,256,"%s",gPlayers[playerid]);
plInfo[playerid][pX] = x, plInfo[playerid][pY] = y, plInfo[playerid][pZ] = z;
plInfo[playerid][JoinLMS] = 1;
SetPlayerPos(playerid,gLMS[PosXS], gLMS[PosYS], gLMS[PosZS], 0,0);
if (IsPlayerInAnyVehicle(playerid)) plInfo[playerid][LastVehicle] = GetPlayerVehicleID(playerid);
return 1;
}
//==============================================================================
public CloseJoinLMS()
{
if (gLMS[CountLMS] == 0) {MessageAll(BLUE, "LMS has closed because no players."); SetTimer("QuitBugLMS",1000,0);}
if (gLMS[CountLMS] == 1) {MessageAll(BLUE, "LMS has closed because need more players."); QuitPlayerLMS();}
else if (gLMS[CountLMS] >= 2) {
MessageAll(BLUE, "LMS is now closed, you can't get at moment.");
MessageAll(BLUE, "Starting the game Last Man Standing.");
gLMS[LockLMS] = 1;
SetTimer("CountLMS1", 1000, 0);
SetTimer("CountLMS2", 2000, 0);
SetTimer("CountLMS3", 3000, 0);
SetTimer("CountLMS4", 4000, 0);
}
return 1;
}
//==============================================================================
public StarGameLMS()
{
if (gLMS[CountLMS] == 0) {MessageAll(BLUE, "LMS has ended because no players."); KillTimer(LMS1); SetTimer("QuitBugLMS",1000,0);}
else if (gLMS[CountLMS] == 1) {MessageAll(BLUE, "LMS has completed and a winner."); KillTimer(LMS1); SetTimer("InfoPlayerWinLMS",500,0); SetTimer("SendPlayerRewardLMS",1000,0);}
else if (gLMS[CountLMS] >= 2) {
for(new i = 0; i <= MAX_PLAYERS; i++) {
new plr = FindPlayerIDFromString(gPlayers);
if(plInfo[plr][JoinLMS] == 1){
if(!NeedPlayerInArea(plr,gLMS[MinXS],gLMS[MaxXS],gLMS[MinYS],gLMS[MaxYS])) {SetPlayerPos(plr,gLMS[PosXS], gLMS[PosYS], gLMS[PosZS], 0,0); GameTextForPlayerBottom(plr,"~h~re-join!");}
else GameTextForPlayerBottom(plr,"\x10");
}
}
}
return 1;
}
//==============================================================================
public QuitPlayerLMS()
{
SetTimer("QuitBugLMS",2000,0);
for(new i = 0; i <= MAX_PLAYERS; i++) {
new plr = FindPlayerIDFromString(gPlayers);
if(plInfo[plr][JoinLMS] == 1){
gLMS[LockLMS] = 0, gLMS[OnLMS] = 0, plInfo[plr][JoinLMS] = 0;
TogglePlayerControllable(plr,1);
SetPlayerWeapon(plr,19,9999);
SetPlayerWeapon(plr,22,9999);
SetPlayerWeapon(plr,32,9999);
DecLMSCount(1);
if (plInfo[plr][LastVehicle] >= 1) {PutDirectlyInVehicle(plr,plInfo[plr][LastVehicle]); plInfo[plr][LastVehicle] = 0;}
else SetPlayerPos(plr,plInfo[plr][pX],plInfo[plr][pY],plInfo[plr][pZ],0,0);
}
}
return 1;
}
//==============================================================================
public QuitBugLMS()
{
gLMS[LockLMS] = 0;
gLMS[OnLMS] = 0;
gLMS[CountLMS] = 0;
}
//==============================================================================
public InfoPlayerWinLMS()// Funcion para determinar el que gano.
{
gLMS[LockLMS] = 0, gLMS[OnLMS] = 0, gLMS[CountLMS] = 0;
for(new i = 0; i <= MAX_PLAYERS; i++) {
new plr = FindPlayerIDFromString(gPlayers);
if(plInfo[plr][JoinLMS] == 1){
format(MSN,256,"%s",gPlayers[plr]);
gLMS[WinnerS] = MSN;
}
}
return 1;
}
//==============================================================================
public SendPlayerRewardLMS()// Funcion para determinar el que gano.
{
new plr = FindPlayerIDFromString(gLMS[WinnerS]);
TextBigAllFormat("~h~ LMS winner: ~o~%s",gPlayers[plr]);
MessageAllFormat(BLUE, "%s is the winner of LMS, Reward:$ %d.",gPlayers[plr],gLMS[RewS]);
IncPlayerCash(plr,gLMS[RewS]);
SetPlayerWeapon(plr,15,9999);
SetPlayerWeapon(plr,17,9999);
SetPlayerWeapon(plr,29,9999);
SetPlayerPos(plr,plInfo[plr][pX],plInfo[plr][pY],plInfo[plr][pZ],0,0);
IncPlayerWinLMS(plr,1);
plInfo[plr][JoinLMS] = 0;
SetTimer("QuitBugLMS",1000,0);
if (plInfo[plr][LastVehicle] >= 1) {PutDirectlyInVehicle(plr,plInfo[plr][LastVehicle]); plInfo[plr][LastVehicle] = 0;}
else SetPlayerPos(plr,plInfo[plr][pX],plInfo[plr][pY],plInfo[plr][pZ],0,0);
}
//==============================================================================
public CountLMS1()
{
for(new i = 0; i <= MAX_PLAYERS; i++) {
new plr = FindPlayerIDFromString(gPlayers);
if(plInfo[plr][JoinLMS] == 1){
GameTextForPlayer(plr,"~b~-~y~ 3 ~b~-");
}
}
return 1;
}
//==============================================================================
public CountLMS2()
{
for(new i = 0; i <= MAX_PLAYERS; i++) {
new plr = FindPlayerIDFromString(gPlayers);
if(plInfo[plr][JoinLMS] == 1){
GameTextForPlayer(plr,"~b~-~x~ 2 ~b~-");
}
}
return 1;
}
//==============================================================================
public CountLMS3()
{
for(new i = 0; i <= MAX_PLAYERS; i++) {
new plr = FindPlayerIDFromString(gPlayers);
if(plInfo[plr][JoinLMS] == 1){
GameTextForPlayer(plr,"~b~-~h~ 1 ~b~-");
}
}
return 1;
}
//==============================================================================
public CountLMS4()
{
LMS1 = SetTimer("StarGameLMS",1000,1);
for(new i = 0; i <= MAX_PLAYERS; i++) {
new plr = FindPlayerIDFromString(gPlayers);
if(plInfo[JoinLMS] == 1){
GameTextForPlayer(plr,"~b~- ~o~Go! Go! Go! ~b~-");
SetPlayerWeapon(plr,21,9999);
SetPlayerWeapon(plr,23,9999);
SetPlayerWeapon(plr,32,9999);
SetPlayerHealth(plr,100.0);
TogglePlayerControllable(plr,1);
}
}
return 1;
}
//==============================================================================
public GetLMSCount()
{
return gLMS[CountLMS];
}
//==============================================================================
public IncLMSCount(amount)
{
gLMS[CountLMS] = gLMS[CountLMS] + amount;
}
//==============================================================================
public DecLMSCount(amount)
{
gLMS[CountLMS] = gLMS[CountLMS] - amount;
}
//==============================================================================
[/pawn]
Now Race System
[pawn]new Race[MAX_PLAYERS];[/pawn]
[pawn] else if ( strcmp( cmd, "!race", true ) == 0 )
{
new cash;
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else if(Race[playerid] == 1) SendClientMessage(playerid, GREEN,"[Error]: Race currently activated.");
else
{
SendClientMessage(playerid, BLUE,"Joined, waiting more players...");
SendClientMessage(playerid, RED,"Your Race Is From Here To SunShine Autos");
SendClientMessage(playerid, RED,"[Server]: Enter In Any Car, Dont try To Kill Any Player.");
Race[playerid] = 1;
SetPlayerPos(playerid,-838.9772,562.1517, 10.9280, 0, 0);
SetPlayerMoney(playerid,cash+5000);
}
return 1;
}
else if ( strcmp( cmd, "!race2", true ) == 0 )
{
new cash;
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else if(Race[playerid] == 1) SendClientMessage(playerid, GREEN,"[Error]: Race currently activated.");
else
{
SendClientMessage(playerid, BLUE,"Joined, waiting more players...");
SendClientMessage(playerid, RED,"Your Race Is From Here To Prawn Island Bridge");
SendClientMessage(playerid, RED,"[Server]: Enter In Any Car, Dont try To Kill Any Player.");
SetPlayerPos(playerid,-1740.8760,-1736.2510, 14.8680, 0, 0);
SetPlayerMoney(playerid,cash+5000);
Race[playerid] = 1;
}
return 1;
} [/pawn]
CREDITS
SALUTE SYSTEM = Spider[Me]
WANTED SYSTEM = Spider[Me]
RACE SYSTEM = Spider[me]
LMS SYSTEM = From Warcheif Pawn
Reward System From Warcheif
SAW A BUG REPORT IT NOW!!!!!!!!!