16
mIRC/pawn Scripting / Re: Help me!
« on: July 14, 2013, 05:00:07 am »
Who is you? kkkk....
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
if(strfind(cmd, "!afk", true, 0) != -1)
{
if(!playerisafk[playerid])
{
GetPlayerPos(playerid, px, py, pz);
new string[256];
format(string, sizeof(string), "%s is now AFK (Away from keyboard).", pname);
SendClientMessageToAll(0xFF875AA, string);
SetPlayerPos(playerid, 474.23223, -1717.48022, 62.5, 135, 0); // change date coords on your own (I've made it lighthouse's rooftop for a standart ;).
TogglePlayerControllable(playerid, 0);
playerisafk[playerid]=1;
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "You are still in the AFK mode.");
}
return 1;
}
else if(strfind(cmd, "!back", true, 0) != -1)
{
if(!playerisafk[playerid])
{
SendClientMessage(playerid, 0xFF0000AA, "You are not in the AFK mode.");
}
else
{
new string2[256];
format(string2, sizeof(string2), "%s is now Back", pname);
SendClientMessageToAll(0xFF875AA, string2);
SetPlayerPos(playerid, px, py, pz, 0, 0);
TogglePlayerControllable(playerid, 1);
playerisafk[playerid]=0;
}
return 1;
}
if (strcmp(cmd, "!goto", true) == 0)
{
tmp = strtok(cmdtext, idx);
new len = strlen(tmp);
if (!len) { format(szMsg,sizeof(szMsg),"Usage: !goto <name/id>",tmp);
SendClientMessage(playerid, COLOR_GREY, szMsg);return 1;}
newvar = FindPlayerIDFromString(tmp);
if (newvar != INACTIVE_PLAYER_ID) {
GetPlayerPos(newvar,x,y,z);
SetPlayerPos(playerid,x,y + 1.0,z,0,0);
format(szMsg,sizeof(szMsg),"Taking [%i] %s to [%i] %s.",playerid,gPlayers[playerid],newvar,gPlayers[newvar]);
SendClientMessageToAll(COLOR_GREEN, szMsg);
}
return 1;
}
else if (strcmp(cmd, "jail", true) == 0) {
if(IsPlayerAdmin(playerid))
{
new time[256],reason[256],plr;
tmp = strtok(cmdtext, idx),plr = FindPlayerIDFromString(tmp),time = strtok(cmdtext, idx),reason = strtok(cmdtext, idx);
if(Jail[plr] == 1) {
SendClientMessage(playerid,NOTACCES,"This Player Is In Jail !");
}
if(Jail[plr] == 0) {
if (!strlen(tmp) || !strlen(time) || !strlen(reason)) SendClientMessage(playerid,COLOR_RED, "USAGE: /c jail [Nick] [Min] [Reason]");
else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
else {
new string[256];
SetPlayerRandomJailSpawns(plr);
SetPlayerWeapon(plr,0,0);
SetPlayerWeapon(plr,0,0);
SetPlayerWeapon(plr,0,0);
SendClientMessageToAll(COLOR_YELLOW, string);
format(string,sizeof(string),"Reason:[ %s ].",cmdtext[strlen(tmp)+7]);
SendClientMessageToAll(COLOR_YELLOW, string);
SendClientMessage(plr,COLOR_YELLOW,"You have been jailed !");
SetTimer("unjail",(strval(time)*60000),false);
Jail[plr] = 1;
TogglePlayerControllable(plr,0);
}
}
}else{
SendClientMessage(playerid,NOTACCES,"***Not have permission to use this command!");
}
return 1;
}
else if(strcmp(cmd, "unjail", true) == 0) {
if(IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx); new plr = FindPlayerIDFromString(tmp);
if(Jail[plr] == 0) {
SendClientMessage(playerid,NOTACCES,"This Player Is Not In Jail !");
}
if(Jail[plr] == 1) {
if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED, "USAGE: /c unjail [Nick]");
else{
if (plr != INACTIVE_PLAYER_ID) {
new string[256];
format(string,sizeof(string),"Admin %s has unjailed %s!",gPlayers[playerid],gPlayers[plr]);
SendClientMessageToAll(COLOR_YELLOW, string);
SetPlayerPos(plr,397.688, -471.821, 11.5172,0,0);
SendClientMessage(plr,COLOR_YELLOW,"You have been unjailed !");
Jail[plr] = 0;
TogglePlayerControllable(plr,1);
}
else SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
}
}
}else{
SendClientMessage(playerid,NOTACCES,"***Not have permission to use this command!");
}
return 1;
}
else if(strcmp(cmd, "buybomb", true) == 0) {
new cash = GetPlayerMoney(playerid);
if(HaveBomb[playerid] == 1) {
SendClientMessage(playerid,0xAA3333AA,"Already have a bomb !");
}
if(HaveBomb[playerid] == 0) {
if(cash >= 3000) {
SetPlayerMoney(playerid,cash - 3000);
HaveBomb[playerid] = 1;
SendClientMessage(playerid,0xFFFFFFAA,"You bought a bomb that has cost you $ 3,000");
}
if(cash < 3000) {
SendClientMessage(playerid,0xAA3333AA,"You do not have enough money to buy a bomb, need $ 3,000");
}
}
return 1;
}
else if(strcmp(cmd, "plantbomb", true) == 0) {
if(IsPlayerInAnyVehicle(playerid)) {
new vehicleid = GetPlayerVehicleID(playerid);
if(HaveBomb[playerid] == 1) {
if(BombPlanted[vehicleid] == 1) {
SendClientMessage(playerid,0xAA3333AA,"In this car is already planted a bomb !");
}
if(BombPlanted[vehicleid] == 0) {
BombPlanted[vehicleid] = 1;
RemovePlayerFromVehicle(playerid);
HaveBomb[playerid] = 0;
SendClientMessage(playerid,0xFFFFFFAA,"The bomb was planted successfully");
SendClientMessage(playerid,0xFFFFFFAA,"The next player to enter the car as a driver will be stuck in the car and the bomb will be detonated!");
}
}
else {
SendClientMessage(playerid,0xAA3333AA,"You must first buy a bomb !");
}
}
else {
SendClientMessage(playerid,0xAA3333AA,"You need to be in a vehicle !");
}
return 1;
}
else if(strcmp(cmd, "fhelp", true) == 0) {
SendClientMessage(playerid,COLOR_YELLOW,"-----------Fishing Help-----------");
SendClientMessage(playerid,COLOR_YELLOW,"For a good job, type '/aim' before fishing !");
SendClientMessage(playerid,COLOR_YELLOW,"For eat,sell,live fish type '[/c] eatf, sellf,livef' !");
SendClientMessage(playerid,COLOR_YELLOW,"For Fishing type '/c fishing' !");
SendClientMessage(playerid,COLOR_YELLOW,"For buy rod and worms type '/c buyrod' , '/c buyworms' at shop !");
SendClientMessage(playerid,COLOR_YELLOW,"For put the fishing rod in your hand type '/c rod' !");
SendClientMessage(playerid,COLOR_YELLOW,"-----------Fishing Help-----------");
return 1;
}
else if(strcmp(cmd, "rod", true) == 0) {
if(boughtr[playerid] == 1) {
GivePlayerWeapon(playerid,3,1);
}
if(boughtr[playerid] == 0) {
SendClientMessage(playerid,COLOR_GREEN,"You don't have a fishing rod! Go to shop to buy!");
}
return 1;
}
else if(strcmp(cmd, "buyrod", true) == 0) {
if((7, playerid, -712.7392, -1500.4816, 11.4436)) {
new cash = GetPlayerMoney(playerid);
if(boughtr[playerid] == 1) {
SendClientMessage(playerid,COLOR_YELLOW,"Already have a fishing rod!");
SendClientMessage(playerid,COLOR_YELLOW,"For put the rod in your hand type '/c rod' !");
}
if(boughtr[playerid] == 0) {
if(cash >= 5000) {
SendClientMessage(playerid,COLOR_YELLOW,"You bought a fishing rod!");
GivePlayerWeapon(playerid,3,1);
boughtr[playerid] = 1;
SetPlayerMoney(playerid,GetPlayerMoney(playerid) - 5000);
}
if(cash < 5000) {
SendClientMessage(playerid,COLOR_YELLOW,"Need more money ! Need $5000 for this rod!");
}
}
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"You not are at shop!");
}
return 1;
}
else if(strcmp(cmd, "buyworms", true) == 0) {
if((7, playerid, -712.7392, -1500.4816, 11.4436)) {
new cash = GetPlayerMoney(playerid);
if(boughtw[playerid] > 0 && boughtw[playerid] < 10) {
SendClientMessage(playerid,COLOR_YELLOW,"You have worms!");
}
if(boughtw[playerid] == 0) {
if(cash >= 3000) {
SendClientMessage(playerid,COLOR_YELLOW,"You bought 10 worms !");
boughtw[playerid] = 10;
SetPlayerMoney(playerid,GetPlayerMoney(playerid) - 3000);
}
if(cash < 3000) {
SendClientMessage(playerid,COLOR_YELLOW,"Need more money ! Need $3000 for worms!");
}
}
}
else
{
SendClientMessage(playerid,COLOR_GREEN,"You not are at shop!");
}
return 1;
}
else if(strcmp(cmd, "sellf", true) == 0) {
new rand = random(sizeof(randomfish));
if(hfish[playerid] == 0) {
SendClientMessage(playerid,COLOR_GREEN,"You don't have a fish!");
}
if(hfish[playerid] == 1) {
SendClientMessage(playerid,COLOR_YELLOW,"You sold your fish for money!");
SetPlayerMoney(playerid,GetPlayerMoney(playerid) + randomfish[rand][mon]);
hfish[playerid] = 0;
}
return 1;
}
else if(strcmp(cmd, "eatf", true) == 0) {
new rand = random(sizeof(randomfish));
new Float:Health;
GetPlayerHealth(playerid,Health);
if(hfish[playerid] == 0) {
SendClientMessage(playerid,COLOR_GREEN,"You don't have a fish!");
}
if(hfish[playerid] == 1) {
SendClientMessage(playerid,COLOR_YELLOW,"You ate your fish for health!");
SetPlayerHealth(playerid,Health + randomfish[rand][hp]);
hfish[playerid] = 0;
}
return 1;
}
else if(strcmp(cmd, "leavef", true) == 0) {
if(hfish[playerid] == 0) {
SendClientMessage(playerid,COLOR_GREEN,"You don't have a fish!");
}
if(hfish[playerid] == 1) {
SendClientMessage(playerid,COLOR_YELLOW,"You want to live your fish, so.. say Bye!");
SendClientMessage(playerid,COLOR_YELLOW,"The fish say: Thank You Very Much! Im so happy!");
hfish[playerid] = 0;
}
return 1;
}
else if(strcmp(cmd, "fishing", true) == 0) {
if((30, playerid,-563.4057, -1514.9204, 4.8351 ) || (30, playerid,-600.0203, -1527.4523, 5.9322) || (30,playerid,-627.0029, -1516.8279, 8.1077) || (30,playerid,-580.3753, -1475.2249, 4.0794) || (30,playerid,-621.3587, -1459.5869, 3.7448)) {
if(fishing[playerid] == 1) {
SendClientMessage(playerid,COLOR_GREEN,"Already Fishing!");
}
if(fishing[playerid] == 0) {
if(boughtr[playerid] == 0) {
SendClientMessage(playerid,COLOR_GREEN,"Need rod for fishing! Go to shop to buy!");
}
if(boughtr[playerid] == 1) {
if(boughtw[playerid] == 0) {
GameTextForPlayer(playerid,"~o~not have worms!");
SendClientMessage(playerid,COLOR_GREEN,"Not have worms! Go to shop to buy!");
}
if(boughtw[playerid] == 1) {
GameTextForPlayer(playerid,"~o~For a good job, type ~w~/aim ~o~!");
SendClientMessage(playerid,COLOR_YELLOW,"Wait 5 seconds to find a fish!");
SendClientMessage(playerid,COLOR_YELLOW,"Now, you have just 1 worm!");
SetTimer("waitfish", 5000, false);
fishing[playerid] = 1;
boughtw[playerid] = 0;
TogglePlayerControllable(playerid,0);
GivePlayerWeapon(playerid,3,1);
}
if(boughtw[playerid] == 2) {
GameTextForPlayer(playerid,"~o~For a good job, type ~w~/aim ~o~!");
SendClientMessage(playerid,COLOR_YELLOW,"Wait 5 seconds to find a fish!");
SendClientMessage(playerid,COLOR_YELLOW,"Now, you have just 1 worm!");
SetTimer("waitfish", 5000, false);
fishing[playerid] = 1;
boughtw[playerid] = 1;
TogglePlayerControllable(playerid,0);
GivePlayerWeapon(playerid,3,1);
}
if(boughtw[playerid] == 3) {
GameTextForPlayer(playerid,"~o~For a good job, type ~w~/aim ~o~!");
SendClientMessage(playerid,COLOR_YELLOW,"Wait 5 seconds to find a fish!");
SendClientMessage(playerid,COLOR_YELLOW,"Now, you have just 2 worms!");
SetTimer("waitfish", 5000, false);
fishing[playerid] = 1;
boughtw[playerid] = 2;
TogglePlayerControllable(playerid,0);
GivePlayerWeapon(playerid,3,1);
}
if(boughtw[playerid] == 4) {
GameTextForPlayer(playerid,"~o~For a good job, type ~w~/aim ~o~!");
SendClientMessage(playerid,COLOR_YELLOW,"Wait 5 seconds to find a fish!");
SendClientMessage(playerid,COLOR_YELLOW,"Now, you have just 3 worms!");
SetTimer("waitfish", 5000, false);
fishing[playerid] = 1;
boughtw[playerid] = 3;
TogglePlayerControllable(playerid,0);
GivePlayerWeapon(playerid,3,1);
}
if(boughtw[playerid] == 5) {
GameTextForPlayer(playerid,"~o~For a good job, type ~w~/aim ~o~!");
SendClientMessage(playerid,COLOR_YELLOW,"Wait 5 seconds to find a fish!");
SendClientMessage(playerid,COLOR_YELLOW,"Now, you have just 4 worms!");
SetTimer("waitfish", 5000, false);
fishing[playerid] = 1;
boughtw[playerid] = 4;
TogglePlayerControllable(playerid,0);
GivePlayerWeapon(playerid,3,1);
}
if(boughtw[playerid] == 6) {
GameTextForPlayer(playerid,"~o~For a good job, type ~w~/aim ~o~!");
SendClientMessage(playerid,COLOR_YELLOW,"Wait 5 seconds to find a fish!");
SendClientMessage(playerid,COLOR_YELLOW,"Now, you have just 5 worms!");
SetTimer("waitfish", 5000, false);
fishing[playerid] = 1;
boughtw[playerid] = 5;
TogglePlayerControllable(playerid,0);
GivePlayerWeapon(playerid,3,1);
}
if(boughtw[playerid] == 7) {
GameTextForPlayer(playerid,"~o~For a good job, type ~w~/aim ~o~!");
SendClientMessage(playerid,COLOR_YELLOW,"Wait 5 seconds to find a fish!");
SendClientMessage(playerid,COLOR_YELLOW,"Now, you have just 6 worms!");
SetTimer("waitfish", 5000, false);
fishing[playerid] = 1;
boughtw[playerid] = 6;
TogglePlayerControllable(playerid,0);
GivePlayerWeapon(playerid,3,1);
}
if(boughtw[playerid] == 8) {
GameTextForPlayer(playerid,"~o~For a good job, type ~w~/aim ~o~!");
SendClientMessage(playerid,COLOR_YELLOW,"Wait 5 seconds to find a fish!");
SendClientMessage(playerid,COLOR_YELLOW,"Now, you have just 7 worms!");
SetTimer("waitfish", 5000, false);
fishing[playerid] = 1;
boughtw[playerid] = 7;
TogglePlayerControllable(playerid,0);
GivePlayerWeapon(playerid,3,1);
}
if(boughtw[playerid] == 9) {
GameTextForPlayer(playerid,"~o~For a good job, type ~w~/aim ~o~!");
SendClientMessage(playerid,COLOR_YELLOW,"Wait 5 seconds to find a fish!");
SendClientMessage(playerid,COLOR_YELLOW,"Now, you have just 8 worms!");
SetTimer("waitfish", 5000, false);
fishing[playerid] = 1;
boughtw[playerid] = 8;
TogglePlayerControllable(playerid,0);
GivePlayerWeapon(playerid,3,1);
}
if(boughtw[playerid] == 10) {
GameTextForPlayer(playerid,"~o~For a good job, type ~w~/aim ~o~!");
SendClientMessage(playerid,COLOR_YELLOW,"Wait 5 seconds to find a fish!");
SendClientMessage(playerid,COLOR_YELLOW,"Now, you have just 9 worms!");
SetTimer("waitfish", 5000, false);
fishing[playerid] = 1;
boughtw[playerid] = 9;
TogglePlayerControllable(playerid,0);
GivePlayerWeapon(playerid,3,1);
}
}
}
}
else
{
SendClientMessage(playerid,COLOR_GREEN,"You not are at port, on legal zone!");
}
return 1;
}
else if (strcmp(cmd, "!hp", true) == 0)
{
tmp = strtok(cmdtext, idx);
if (!strlen(tmp)) {
GetPlayerHealth(playerid,x);
GetPlayerArmour(playerid,y);
SetSpikes(playerid,1);
if (IsPlayerInAnyVehicle(playerid))
{
GetVehicleHealth(GetPlayerVehicleID(playerid),z);
format(szMsg,sizeof(szMsg),"[%i] %s - Health %.0f - Armour %.0 Vehicle Health %.0f",playerid,gPlayers[playerid],x,y,z);
} else {
format(szMsg,sizeof(szMsg),"[%i] %s - Health %.1f - Armour %.1f",playerid,gPlayers[playerid],x,y);
}
SendClientMessageToAll(COLOR_GREEN, szMsg);
} else {
newvar = FindPlayerIDFromString(tmp);
if (newvar != INACTIVE_PLAYER_ID) {
GetPlayerHealth(newvar,x);
GetPlayerArmour(newvar,y);
if (IsPlayerInAnyVehicle(newvar))
{
GetVehicleHealth(GetPlayerVehicleID(newvar),z);
format(szMsg,sizeof(szMsg),"[%i] %s - Health %.0f - Armour %.0 Vehicle Health %.0f",newvar,gPlayers[newvar],x,y,z);
} else {
format(szMsg,sizeof(szMsg),"[%i] %s - Health %.0f - Armour %.0f",newvar,gPlayers[newvar],x,y); }
SendClientMessageToAll(COLOR_GREEN, szMsg);
}
}
return 1;
}
else if (strcmp(cmd, "robbank", true) == 0) {
{
tmp = strtok(cmdtext, idx);
if(Maletin[playerid] == 1) {
SendClientMessage(playerid,0xAA3333AA,"You've robbed the bank! You can not steal it again!");
}
else if((playerid,-945.0223,-938.2779,-346.0285,-341.7365)) SendClientMessage(playerid, COLOR_GREEN,"[Error] - You must be in the bank vault to steal it!");
else {
GameTextForPlayerBottom(playerid,"~y~ >>>>");
TogglePlayerControllable(playerid,0);
SetTimer("roboenprogreso", 9000, false);
SendClientMessage(playerid, COLOR_YELLOW,"Right now you're robbing the bank");
SetWantedLevel(playerid,6);
format( szMsg, sizeof( szMsg ), "%s is robbing the bank, the police has been informed", gPlayers[ playerid ], cmdtext[ strlen( tmp ) +8 ] );
SendClientMessageToAll( COLOR_YELLOW, szMsg );
SetPlayerMarker(playerid,15);
SetPlayerSkin(playerid,0);
SetPlayerSkin(playerid,129);
ToggleGreenScanlinesForPlayer(playerid,1);
ToggleWidescreenForPlayer(playerid,1);
Maletin[playerid] = 1;
}
}
return 1;
}
else if ( strcmp( cmd, "botoff", true ) == 0 )
{
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
give us the public which includes 1244'th string, we will try to fix this
{382.1467,-505.1280,9.3956},
{384.9164,-502.2434,9.3956},
{387.6998,-499.4460,9.3956}
};
forward SetPlayerRandomJailSpawns(playerid);
forward unjail();
forward SendMSG();
new RandomMSG2[][]=
{
"[BOT] : HELLO VCMP",
"[BOT] : How Are You All",
"[BOT] : Dont HAck Or Get Ban",
"[BOT] : Dont Abuse Or Ban",
"[BOT] : use /c getcar and get any vehicle",
"[BOT] : I Am Created By Spider",
"[BOT] : Server Is Created By Spider"
};
forward SendMSG2();
//------------------------------------------------------------------------------------------------------
main()
{
print("\n ----------------------------------\n");
printf(" %s\n",szGameModeName);
printf(" \tby %s\n",szGameModeAuthorName);
print(" ----------------------------------\n");
}
//------------------------------------------------------------------------------------------------------
public OnRconCommand(cmd[])
{
new tmp[256];
new idx;
new cmdt[256];
cmdt = strtok(cmd,idx);
if(strcmp(cmdt,"/say",true) == 0)
{
tmp = strtok(cmd,idx);
if (!strlen(tmp)) printf(">>ConsoleError: /say [message]");
else {
new string[256];
format(string,sizeof(string),">>Owner: %s",cmd[5]);
SendClientMessageToAll(COLOR_GREY,string);
printf(string);
}
return 1;
}
return 0;
}
public OnFilterScriptInit()
{
print("------------------------------------------------------------------------------");
print(" ConsoleChat System (by Alex) is loaded. ");
print("------------------------------------------------------------------------------");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerConnect(playerid)
{
SetWaterLevel(8.0);
SetGamespeed(100);
SetGravity(90);
Jumpswitch(1);
GetPlayerName(playerid,gPlayers[playerid],MAX_PLAYER_NAME);
GameTextForPlayer( playerid, "~g~Welcome to Alex" );
SetPlayerMoney(playerid,0);
EnableStuntBike(playerid,1);
EnableShootInAir(playerid,1);
SetTimer("SendMSG", 10000, true);
SetTimer("SendMSG2", 10000, true);
SetTimer("DisplayBots",1000*60*1,1);
SetTimer("timechange", 10000, false);
new string[256];
format(string,256,"** [%d] %s has joined the server.",playerid,gPlayers[playerid]);
print(string);
format(string,256,"3** [%d] %s has joined the server.",playerid,gPlayers[playerid]);
return 1;
}
new RandomXMS[][] =
{
"~t~.~x~.~o~.~y~.~t~.~x~.~o~.~y~.~t~.~x~.~o~.~y~x~t~m~x~a~o~s~x~.~y~.~t~.~x~.~o~.~y~.~t~.~x~.~o~.~y~.~t~.~x~.~o~.",
"~x~.~o~.~y~.~t~.~x~.~o~.~y~.~t~.~x~.~o~.~y~.~t~x~x~m~o~a~y~s~y~.~t~.~x~.~o~.~y~.~t~.~x~.~o~.~y~.~t~.~x~.~o~.~y~.",
"~o~.~y~.~t~.~x~.~o~.~y~.~t~.~x~.~o~.~y~.~t~.~x~x~o~m~y~a~t~s~o~.~x~.~o~.~y~.~t~.~x~.~o~.~y~.~t~.~x~.~o~.~y~.~t~.",
"~y~.~t~.~x~.~o~.~y~.~t~.~x~.~o~.~y~.~t~.~x~.~o~x~y~m~t~a~x~s~x~.~o~.~y~.~t~.~x~.~o~.~y~.~t~.~x~.~o~.~y~.~t~.~x~."
// "~x~-~t~-~o~-~y~-~x~-~t~-~o~-~y~-~x~-~t~-~o~-~y~-~x~x~t~m~o~a~y~s~x~-~t~-~o~-~y~-~x~-~t~-~o~-~y~-~x~-",
// "~t~-~o~-~y~-~x~-~t~-~o~-~y~-~x~-~t~-~o~-~y~-~x~-~t~x~o~m~y~a~x~s~t~-~o~-~y~-~x~-~t~-~o~-~y~-~x~-~t~-",
// "~o~-~y~-~x~-~t~-~o~-~y~-~x~-~t~-~o~-~y~-~x~-~t~-~o~x~y~m~x~a~t~s~o~-~y~-~x~-~t~-~o~-~y~-~x~-~t~-~o~-",
// "~y~-~x~-~t~-~o~-~y~-~x~-~t~-~o~-~y~-~x~-~t~-~o~-~y~x~x~m~t~a~o~s~y~-~x~-~t~-~o~-~y~-~x~-~t~-~o~-~y~-"
};
//------------------------------------------------------------------------------------------------------
public OnPlayerDisconnect(playerid, reason)
{
Maletin[playerid] = 0;
HaveBomb[playerid] = 0;
fishing[playerid] = 0;
boughtw[playerid] = 0;
boughtr[playerid] = 0;
hfish[playerid] = 0;
Jail[playerid] = 0;
return 1;
}
//------------------------------------------------------------------------------------------------------
public OnPlayerEnterVehicle(playerid,vehicleid,ispassenger)
{
GivePlayerWeapon(playerid, 22, 200);
GivePlayerMoney(playerid,50);
GetPlayerVehicleID(playerid);
if(BombPlanted[vehicleid] == 1) {
SendClientMessage(playerid,0xAA3333AA,"In this vehicle is a bomb planted ! You can't leave !");
SetVehicleHealth(vehicleid,0);
PutDirectlyInVehicle(playerid,vehicleid); // it keeps you in the car
BombPlanted[vehicleid] = 0;
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
RemovePlayerFromVehicle(playerid);
return 1;
}
//------------------------------------------------------------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new tmp[256];
new szMsg[256];
new idx, newvar;
new Float:x, Float:y, Float:z;
cmd = strtok(cmdtext, idx);
if (strcmp(cmd, "hp", true) == 0)
{
tmp = strtok(cmdtext, idx);
if (!strlen(tmp)) {
GetPlayerHealth(playerid,x);
GetPlayerArmour(playerid,y);
SetSpikes(playerid,1);
if (IsPlayerInAnyVehicle(playerid))
{
GetVehicleHealth(GetPlayerVehicleID(playerid),z);
format(szMsg,sizeof(szMsg),"[%i] %s - Health %.0f - Armour %.0 Vehicle Health %.0f",playerid,gPlayers[playerid],x,y,z);
} else {
format(szMsg,sizeof(szMsg),"[%i] %s - Health %.1f - Armour %.1f",playerid,gPlayers[playerid],x,y);
}
SendClientMessageToAll(COLOR_GREEN, szMsg);
} else {
newvar = FindPlayerIDFromString(tmp);
if (newvar != INACTIVE_PLAYER_ID) {
GetPlayerHealth(newvar,x);
GetPlayerArmour(newvar,y);
if (IsPlayerInAnyVehicle(newvar))
{
GetVehicleHealth(GetPlayerVehicleID(newvar),z);
format(szMsg,sizeof(szMsg),"[%i] %s - Health %.0f - Armour %.0 Vehicle Health %.0f",newvar,gPlayers[newvar],x,y,z);
} else {
format(szMsg,sizeof(szMsg),"[%i] %s - Health %.0f - Armour %.0f",newvar,gPlayers[newvar],x,y); }
SendClientMessageToAll(COLOR_GREEN, szMsg);
}
}
return 1;
}
if (strcmp(cmd, "ann", true) == 0) {
if (IsPlayerAdmin(playerid)) {
tmp = strtok(cmdtext, idx);
if (!strlen(tmp)) {
SendClientMessage(playerid, COLOR_GREEN, "USAGE: /c ann [Message]");
} else {
new string[256];
format(string, 256, "%s", cmdtext[4]);
GameTextForAll(string);
}
} else {
SendClientMessage(playerid, COLOR_GREEN, " You have not access to use the command!");
}
return 1;
}
if (strcmp(cmd, "bnn", true) == 0) {
if (IsPlayerAdmin(playerid)) {
tmp = strtok(cmdtext, idx);
if (!strlen(tmp)) {
SendClientMessage(playerid, COLOR_GREEN, "USAGE: /c bnn [Message]");
} else {
new string[256];
format(string, 256, "%s", cmdtext[4]);
GameTextForAllBottom(string);
}
} else {
SendClientMessage(playerid, COLOR_GREEN, " You have not access to use the command!");
}
return 1;
}
if (strcmp(cmd, "driveonwater", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SetPlayerDriveOnWater(1);
format(szMsg,sizeof(szMsg),"Drive On Water SET ON");
} else {
format(szMsg,sizeof(szMsg),"Drive On Water SET OFF");
SetPlayerDriveOnWater(0);
}
SendClientMessage(playerid, COLOR_GREEN, szMsg);
return 1;
}
else if (strcmp(cmd, "shootinair", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
EnableShootInAir(255,1);
format(szMsg,sizeof(szMsg),"Shoot In Air Enabled");
} else {
format(szMsg,sizeof(szMsg),"Shoot In Air Disabled");
EnableShootInAir(255,0);
}
SendClientMessage(playerid, COLOR_GREEN, szMsg);
return 1;
}
else if (strcmp(cmd, "stunt", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
EnableStuntBike(255,1);
format(szMsg,sizeof(szMsg),"Stuntbike Enabled");
} else {
format(szMsg,sizeof(szMsg),"Stuntbike Disabled");
EnableStuntBike(255,0);
}
SendClientMessage(playerid, COLOR_GREEN, szMsg);
return 1;
}
else if (strcmp(cmd, "flycar", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
Flyingcars(1);
} else {
Flyingcars(0);
}
return 1;
}
else if (strcmp(cmd, "taxi", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
format(szMsg,sizeof(szMsg),"TaxiBoost Enabled");
Taxiboostjump(1);
} else {
format(szMsg,sizeof(szMsg),"TaxiBoost Disabled");
Taxiboostjump(0);
}
SendClientMessage(playerid, COLOR_GREEN, szMsg);
return 1;
}
else if (strcmp(cmd, "fastswitch", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
FastSwitch(1);
} else {
FastSwitch(0);
}
return 1;
}
else if (strcmp(cmd, "jumpswitch", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
Jumpswitch(1);
} else {
Jumpswitch(0);
}
return 1;
}
else if ( strcmp( cmd, "bigbang", true ) == 0 )
{
format( szMsg, 256, "Exiting from current GameMode." );
GameModeExit();
return 1;
}
else if (strcmp(cmd, "heal", true) == 0)
{
tmp = strtok(cmdtext, idx);
if (!strlen(tmp)) { newvar = playerid; }
else { newvar = FindPlayerIDFromString(tmp); }
if (newvar == INACTIVE_PLAYER_ID) { return 1; }
if (IsPlayerInAnyVehicle(newvar)) {
SetVehicleHealth(GetPlayerVehicleID(newvar),1000.0);
SetVehicleTyre(GetPlayerVehicleID(newvar),1);
SetPlayerHealth(newvar,100.0);
} else {
SetPlayerHealth(newvar,100.0);
}
return 1;
}
else if (strcmp(cmd, "spike", true) == 0)
{
tmp = strtok(cmdtext, idx);
if (!strlen(tmp)) { newvar = playerid; }
else { newvar = FindPlayerIDFromString(tmp); }
if (newvar == INACTIVE_PLAYER_ID) { return 1; }
SetSpikes(playerid,1);
return 1;
}
else if (strcmp(cmd, "wep", true) == 0)
{
tmp = strtok(cmdtext, idx);
new len = strlen(tmp);
if (!len) { format(szMsg,sizeof(szMsg),"Usage: /c wep <name/id>",tmp);SendClientMessage(playerid, COLOR_GREY, szMsg);return 1;}
newvar = FindWepIDFromString(tmp);
if (newvar != 0) { SetPlayerWeapon(playerid,newvar,9999); }
return 1;
}
return 0;
}
//------------------------------------------------------------------------------------------------------
public OnPlayerText(playerid, cmdtext[])
{
new cmd[256];
new tmp[256];
new szMsg[256];
new idx, newvar;
new Float:x, Float:y, Float:z;
cmd = strtok(cmdtext, idx);
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
give us the public which includes 1244'th string, we will try to fix this
97 new RandomMSG2[][]= Wrong:error 001: expected token: ";", but found "&"
100 "[BOT] : HELLO VCMP", Wrong:error 010: invalid function or declaration
108 }; Wrong:error 054: unmatched closing brace ,error 010: invalid function or declaration
616 if((7, playerid, -712.7392, -1500.4816, 11.4436)) { Wrong:warning 206: redundant test: constant expression is non-zero
641 if((7, playerid, -712.7392, -1500.4816, 11.4436)) { Wrong:warning 206: redundant test: constant expression is non-zero
701 if((30, playerid,-563.4057, -1514.9204, 4.8351 ) || (30, playerid,-600.0203, -1527.4523, 5.9322) || (30,playerid,-627.0029, -1516.8279, 8.1077) || (30,playerid,-580.3753, -1475.2249, 4.0794) || (30,playerid,-621.3587, -1459.5869, 3.7448)) { Wrong:warning 206: redundant test: constant expression is non-zero
865 else if((playerid,-945.0223,-938.2779,-346.0285,-341.7365)) SendClientMessage(playerid, COLOR_GREEN,"[Error] - You must be in the bank vault to steal it!"); Wrong:warning 206: redundant test: constant expression is non-zero
888 if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );Wrong:There have five wrong:1.error 012: invalid function call, not a valid address2.warning 215: expression has no effect 3.error 001: expected token: ";", but found ")" 4.error 029: invalid expression, assumed zero 5.fatal error 107: too many error messages on one line