SA-MP Forums Archive
Anything wrong here ? - 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: Anything wrong here ? (/showthread.php?tid=280961)



Anything wrong here ? - Darnell - 03.09.2011

pawn Код:
if(strcmp(cmd, "/bizentrance", true) == 0) {
        if(IsPlayerConnected(playerid)) {
            if(PlayerInfo[playerid][pAdmin] < 10) {
                SendClientMessage(playerid, COLOR_GRAD2, "   You are not an Admin !");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /bizentrance [bizid] - Moves a biz to you");
                return 1;
            }
            new proplev = strval(tmp);
            if(proplev > sizeof(BizzInfo) || proplev < 0) {
                SendClientMessage(playerid,COLOR_WHITE,"Business ID must be above 0 and below 5");
                return 1;
            }
            else {
                new Float:X,Float:Y,Float:Z;
                GetPlayerPos(playerid,X,Y,Z);
                format(string,sizeof(string),"Entrance of Biz %d to %f - %f - %f",proplev,X,Y,Z);
                ABroadCast(COLOR_YELLOW,string,1);
                BizzInfo[proplev][bEntranceX] = X;
                BizzInfo[proplev][bEntranceY] = Y;
                BizzInfo[proplev][bEntranceZ] = Z;
                OnPropUpdate();
                return 1;
            }
        }
        return 1;
    }
I'm pretty sure, because it crashes my server.


Re: Anything wrong here ? - =WoR=Varth - 03.09.2011

Debug it.


Re: Anything wrong here ? - Darnell - 03.09.2011

Fixed.