SA-MP Forums Archive
I do not understand.. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: I do not understand.. (/showthread.php?tid=287687)



I do not understand.. - [GOD]Dragonster82 - 04.10.2011

(55 : error 010: invalid function or declaration

pawn Код:
public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid,Servt);
    SetPlayerWorldBounds(playerid, 2907.791, 175.1681, -910.8743, -2791.012);
    new skink;
    skink=GetPlayerSkin(playerid);
    if(skink==280||skink==286||skink==285||skink==165) {
        SetPlayerTeam(playerid,0);
        PoliceRank[playerid] = 1;
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"Welcome To Team: Police");
        GameTextForPlayer(playerid,"~bl~Police",3000,3);
        PoliceRank[playerid] = 1;                 // Sets the guy's rank to 1, by default for now.
        SetPlayerColor(playerid,COLOR_BLUE);
    }
    if(skink==248||skink==104||skink==107||skink==120) {
        SetPlayerTeam(playerid,1);
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"Welcome To Team :Gangs");
        GameTextForPlayer(playerid,"~r~Gangs",3000,3);
        GangRank[playerid] = 1;                   // Sets the guy's rank to 1, by default for now.
        SetPlayerColor(playerid,COLOR_ORANGE);
    }
    if(skink==270) {
        new pName[MAX_PLAYER_NAME];               // Check if it is darren
        GetPlayerName(playerid,pName,sizeof(pName));
        if(strcmp(pName,"[DCV]Dragon") == 0) {    //String compare between the users name and the selected name.
            new string[128];
            format(string,sizeof(string),"Welcome back Darren, the leader of Gangs.");
            SetPlayerTeam(playerid, 1);           // HAIL THE DARREN / DRAGON
            GangRank[playerid] = 1337;
            SetPlayerColor(playerid, COLOR_PURPLE);
            SendClientMessage(playerid,COLOR_PURPLE,string);
        }
        if(skink==164) {
            new pName2[MAX_PLAYER_NAME];          // Check if it is notis
                                                  // Getting the players name and storing it in pName
            GetPlayerName(playerid, pName2, sizeof(pName2));
                                                  //checks if it is notis too.
            if(strcmp(pName2,"[DCV]Notis") == 0) {
                new string2[128];
                format(string2,sizeof(string2),"Welcome back Notis, the leader of Police.");
                SetPlayerTeam(playerid, 0);
                PoliceRank[playerid] = 1337;
                SetPlayerColor(playerid, COLOR_YELLOW);
                SendClientMessage(playerid,COLOR_WHITE,string2);
            }
            SendClientMessage(playerid,COLOR_BRIGHTRED,"Sorry! You are not darren or notis!");
            Kick(playerid);
        }
    }
}
return 1;
}
the only problem was "return 1;"

WHY!!?


Re: I do not understand.. - spd_sahil - 04.10.2011

u have the extra { there
remove one from the last one and add return 1 a level above


Re: I do not understand.. - [GOD]Dragonster82 - 04.10.2011

Thank you!


Re: I do not understand.. - Unte99 - 04.10.2011

Too late.


Re: I do not understand.. - [GOD]Dragonster82 - 04.10.2011

Another problem has aroused! They would not automatically kick when the person name does not match the strcmp thing.

Edit: Fixed.