Pawn Compiler Crashes =[
#1

Well, first of all.
Thanks for who'll help me, or just who will try to =].

Alright, I'm trying to add something to my mod, so when player will /pickupgun the Anti Cheat won't kick him.

Tried to add the whole 'FS' to the Mod, so I can do : SafeGivePlayerWeapon.
Because in the FS it won't reconize this function.
So I've added it :

PHP Code:
new cmd[256];
    new 
idx;
    
cmd strtok(cmdtextidx);
    if(
strcmp(cmd"/dropgun"true) == || strcmp(cmd"/dgun"true) == 0)
    {
        new 
gunID GetPlayerWeapon(playerid);
        new 
gunAmmo GetPlayerAmmo(playerid);
        if(
gunID != && gunAmmo != 0)
        {
            new 
MAX_OBJ+1;
            for(new 
0sizeof(ObjCoords); a++)
            {
                if(
ObjCoords[a][0] == 0.0)
                {
                    
a;
                    break;
                }
            }
            if(
MAX_OBJ) return SendClientMessage(playerid0x33AA3300"You can not throw weapons at the moment, try back later!!");
            new 
gunname[25];
            new 
buffer[100];
            
GetWeaponNameEx(gunIDgunnamesizeof(gunname));
            
format(buffersizeof(buffer), "You threw %s"gunname);
            
SendClientMessage(playerid0x33AA3300buffer);
            
RemovePlayerWeapon(playeridgunID);
            
ObjectID[f][0] = gunID;
            
ObjectID[f][1] = gunAmmo;
            
GetPlayerPos(playeridObjCoords[f][0], ObjCoords[f][1], ObjCoords[f][2]);
            
object[f] = CreateObject(GunObjects[gunID][0],ObjCoords[f][0],ObjCoords[f][1],ObjCoords[f][2]-1,93.7,120.0,120.0);
            return 
1;
        }
    }
    if(
strcmp(cmd"/pickupgun"true) == || strcmp(cmd"/pgun"true) == 0)
    {
        new 
MAX_OBJ+1;
        for(new 
0sizeof(ObjCoords); a++)
        {
            if(
IsPlayerInRangeOfPoint(playerid5.0ObjCoords[a][0], ObjCoords[a][1], ObjCoords[a][2]))
            {
                
a;
                break;
            }
        }
        if(
MAX_OBJ) return SendClientMessage(playerid0x33AA3300"You are not near the weapon which you can pick up!");
        else
        {
            new 
gunname[25];
            new 
buffer[100];
            
ObjCoords[f][0] = 0.0;
            
ObjCoords[f][1] = 0.0;
            
ObjCoords[f][2] = 0.0;
            
DestroyObject(object[f]);
            
SafeGivePlayerWeapon(playeridObjectID[f][0], ObjectID[f][1]);
            
GetWeaponNameEx(ObjectID[f][0], gunnamesizeof(gunname));
            
format(buffersizeof(buffer), "You picked up %s"gunname);
            
SendClientMessage(playerid0x33AA3300buffer);
        }
        return 
1;
    }
    return 
0;

I wish I could do something, but I've tried few times.

Thanks !
Reply
#2

Amm, Please =[?
Help =[
Reply
#3

Please?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)