1 Error simple help me.
#1

Hey scripters i am trying to make an mg1 cmd,

that if the player types once /mg1 and teleport him to that interior and player cant type /mg1 /mg1 again and again to abuse when player is in /mg1 and when player type again /mg1 it will say you're already in mg1.

Thnx

here is code:-

pawn Код:
CMD:mg1(playerid, params[])
{
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    new string[128];
    new rand = random(sizeof(RandomSpawn));
    IsInMiniGame[playerid] = 1;
    format(string,sizeof(string), "%s has joined the Minigun 1. (/MG1)", pName);
    SendClientMessageToAll(0x33CCFFAA, string);
    SetPlayerVirtualWorld(playerid, 30);
    SetPlayerInterior(playerid, 17);
    GivePlayerWeapon(playerid, 38, 10000);
    SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
    else
    {
        if(IsInMiniGame[playerid] == 1)
        {
             format(string, sizeof(string), "Type ~r~/Exitmg1 to exit from ~g~the MG1!");
             GameTextForPlayer(playerid, string, 3000, 4);
        }
    }
    return 1;
}
and the error:-

pawn Код:
C:\Users\smith\Desktop\Server 2\gamemodes\rrrrrr.pwn(177) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
thnx
Reply
#2

which is the error line?
however I see you are using "else" without an "if" statement before...
Reply
#3

Quote:
Originally Posted by Sascha
Посмотреть сообщение
which is the error line?
however I see you are using "else" without an "if" statement before...
error line is 'else'
Reply
#4

yea... use the code of magazinez..
and for the future:
you cannot use an "else" statement if you didn't use an "if" statement before..
so:
pawn Код:
if (playerid == noob) //THEN DO SOMETHING
else //THEN DO SOMETHING ELSE..
but not..
pawn Код:
//DO SOMETHING
else //DO SOMETHING
the else does something in case the "if" statement is not true... but if there is no "if" statement, there is nothing the "else" can do..
Reply
#5

thanks

What i want that u did.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)