CMD:Addpickup errors
#1

I have the stock for CreateDynamicPickup, i have the path defined, but i dont know why it wont work. What am i doing wrong?

pawn Код:
C:\Users\Tab\Desktop\True Roleplay [0.3c]\True Roleplay [0.3c]\gamemodes\TRP.pwn(91) : warning 201: redefinition of constant/macro (symbol "CMD:%1(%2)")
C:\Users\Tab\Desktop\True Roleplay [0.3c]\True Roleplay [0.3c]\gamemodes\TRP.pwn(279) : error 017: undefined symbol "CreateDynamicPickup"
C:\Users\Tab\Desktop\True Roleplay [0.3c]\True Roleplay [0.3c]\gamemodes\TRP.pwn(678) : error 017: undefined symbol "DestroyAllDynamicPickups"
C:\Users\Tab\Desktop\True Roleplay [0.3c]\True Roleplay [0.3c]\gamemodes\TRP.pwn(2959) : error 017: undefined symbol "CreateDynamicPickup"
C:\Users\Tab\Desktop\True Roleplay [0.3c]\True Roleplay [0.3c]\gamemodes\TRP.pwn(4007) : warning 203: symbol is never used: "InviteFaction"
C:\Users\Tab\Desktop\True Roleplay [0.3c]\True Roleplay [0.3c]\gamemodes\TRP.pwn(4007) : warning 203: symbol is never used: "InviteFamily"
C:\Users\Tab\Desktop\True Roleplay [0.3c]\True Roleplay [0.3c]\gamemodes\TRP.pwn(4007) : warning 203: symbol is never used: "InviteOffer"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
pawn Код:
stock AddPickupFromFile(DFileName[])
{
    if(!fexist(DFileName)) return 0;

    new File:PickupFile, PType, PModel, Float:PX, Float:PY, Float:PZ, pTotal, Line[128];

    PickupFile = fopen(DFileName, io_read);
    while(fread(PickupFile, Line))
    {
        if(Line[0] == '/' || isnull(Line)) continue;
        unformat(Line, "fffii", PX, PY, PZ, PModel, PType);
        CreateDynamicPickup(PModel, PType, PX, PY, PZ, -1, -1, -1, 100.0);//line 279
        pTotal++;
    }
    fclose(PickupFile);
    return pTotal;
}
pawn Код:
public OnGameModeExit()
{
    DestroyAllDynamicPickups();//line 678
    return 1;
}
pawn Код:
CMD:addpickup(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1337)
    {
        new PModel, PType, Float:PX, Float:PY, Float:PZ;
        if(unformat(params, "ih", PModel, PType)) return SendClientMessage(playerid, COLOR_RED,"[USAGE] /AddPickup < Pickup ID > < Spawn Type >");
        GetPlayerPos(playerid, PX, PY, PZ);
        AddPickupToFile(PICKUP_FILE_NAME, PX, PY, PZ, PModel, PType);
        CreateDynamicPickup(PModel, PType, PX, PY, PZ, -1, -1, -1, 100.0);//2959
        new Msg[100];
        format(Msg,sizeof(Msg),"A New Pickup Has Been Added. Model: \"%d\" - Spawn Type: \"%d\"",PModel, PType);
        return SendClientMessage(playerid, COLOR_GREEN, Msg);
    }
    else return AdminCMD(playerid, 5);
}
Reply
#2

Did you included streamer?
Reply
#3

Quote:
Originally Posted by SmiT
Посмотреть сообщение
Did you included streamer?
Yeah i included Streamer, but now whneever i type /addpickup it crashes the server for some reason.
Reply
#4

Quote:
Originally Posted by SantarioLeone
Посмотреть сообщение
Yeah i included Streamer, but now whneever i type /addpickup it crashes the server for some reason.
First off, after including streamer does it give you any more errors/warnings ?
Reply
#5

I have 4 Warnings from commands that are in developement that arent related to the addpickup command but heres the warnings.
pawn Код:
C:\Users\Tab\Desktop\True Roleplay [0.3c]\True Roleplay [0.3c]\gamemodes\TRP.pwn(92) : warning 201: redefinition of constant/macro (symbol "CMD:%1(%2)")
C:\Users\Tab\Desktop\True Roleplay [0.3c]\True Roleplay [0.3c]\gamemodes\TRP.pwn(4008) : warning 203: symbol is never used: "InviteFaction"
C:\Users\Tab\Desktop\True Roleplay [0.3c]\True Roleplay [0.3c]\gamemodes\TRP.pwn(4008) : warning 203: symbol is never used: "InviteFamily"
C:\Users\Tab\Desktop\True Roleplay [0.3c]\True Roleplay [0.3c]\gamemodes\TRP.pwn(4008) : warning 203: symbol is never used: "InviteOffer"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Warnings.
Reply
#6

Quote:
Originally Posted by SantarioLeone
Посмотреть сообщение
I have 4 Warnings from commands that are in developement that arent related to the addpickup command but heres the warnings.
pawn Код:
C:\Users\Tab\Desktop\True Roleplay [0.3c]\True Roleplay [0.3c]\gamemodes\TRP.pwn(92) : warning 201: redefinition of constant/macro (symbol "CMD:%1(%2)")
C:\Users\Tab\Desktop\True Roleplay [0.3c]\True Roleplay [0.3c]\gamemodes\TRP.pwn(4008) : warning 203: symbol is never used: "InviteFaction"
C:\Users\Tab\Desktop\True Roleplay [0.3c]\True Roleplay [0.3c]\gamemodes\TRP.pwn(4008) : warning 203: symbol is never used: "InviteFamily"
C:\Users\Tab\Desktop\True Roleplay [0.3c]\True Roleplay [0.3c]\gamemodes\TRP.pwn(4008) : warning 203: symbol is never used: "InviteOffer"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Warnings.
Post the code containing the lines.
Reply
#7

Line 4008 is non existant, its refering to me not using Lines 204-206
pawn Код:
new InviteOffer[MAX_PLAYERS];//204
new InviteFaction[MAX_PLAYERS];//205
new InviteFamily[MAX_PLAYERS];//206

                                                #define CMD:%1(%2)          \
                                                            forward cmd_%1(%2); \
                                                            public cmd_%1(%2)//92
Reply
#8

Oh god, I don't even know why I asked you to post the warnings, anyways.

I recommend you use sscanf instead of this:

PHP код:
if(unformat(params"ih"PModelPType)) return SendClientMessage(playeridCOLOR_RED,"[USAGE] /AddPickup < Pickup ID > < Spawn Type >"); 
I'm 100% sure its causing your crash.
Reply
#9

Cause the cmd for those three warnings on 204-206 is commented out for right now its just CMD:invite that im working out some things in it. And as far as the other warning with defining "CMD" all i did was follow what was written in a tutorial
Reply
#10

Quote:
Originally Posted by =WoR=G4M3Ov3r
Посмотреть сообщение
Oh god, I don't even know why I asked you to post the warnings, anyways.

I recommend you use sscanf instead of this:

PHP код:
if(unformat(params"ih"PModelPType)) return SendClientMessage(playeridCOLOR_RED,"[USAGE] /AddPickup < Pickup ID > < Spawn Type >"); 
I'm 100% sure its causing your crash.
What?

That is sscanf.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)