errors
#1

Well im trying to call the info from my mysql system but it just give me some errors any help would be great

it compiles fine when i just have this part
Код:
forward PlayerGiveMoney(playerid, money);
stock PlayerGiveMoney(playerid, money) {
    PVAR[playerid][pMoney] += money;//line 1378
    SetPlayerMoney(playerid, PVAR[playerid][pMoney]);
}
but when i add this it give me the errors.
Код:
PlayerGiveMoney(playerid, money); //line 795
Код:
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(795) : error 017: undefined symbol "money"
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(1085) : warning 217: loose indentation
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(1378) : error 017: undefined symbol "PVAR"
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(1378) : warning 215: expression has no effect
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(1378) : error 001: expected token: ";", but found "]"
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(1378) : error 029: invalid expression, assumed zero
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(1378) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Many Thanks
Reply
#2

stock functions does not require declaration. The compiler also does not recognize PVAR as it is undeclared.
Reply
#3

Down to this now

Код:
PlayerGiveMoney(playerid, Money);
Код:
stock PlayerGiveMoney(playerid, money) {
    PVar[playerid][pMoney] += money;
    SetPlayerMoney(playerid, PVar[playerid][pMoney]);
}
Код:
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(801) : error 017: undefined symbol "money"
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(1092) : warning 217: loose indentation
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(1385) : error 017: undefined symbol "SetPlayerMoney"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Thanks for your help so far
Reply
#4

Quote:
Originally Posted by manchestera
Посмотреть сообщение
Down to this now

Код:
PlayerGiveMoney(playerid, Money);
Код:
stock PlayerGiveMoney(playerid, money) {
    PVar[playerid][pMoney] += money;
    SetPlayerMoney(playerid, PVar[playerid][pMoney]);
}
Код:
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(801) : error 017: undefined symbol "money"
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(1092) : warning 217: loose indentation
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(1385) : error 017: undefined symbol "SetPlayerMoney"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Thanks for your help so far
You need to input a value for money when using the function.

pawn Код:
PlayerGiveMoney(playerid, 1000);
SetPlayerMoney is also undeclared. Try using GivePlayerMoney instead.

pawn Код:
stock PlayerGiveMoney(playerid, money) {
    PVar[playerid][pMoney] += money;
    GivePlayerMoney(playerid, PVar[playerid][pMoney]);
}
Reply
#5

Its is calling the info from a mysql database so im not setting the money and i nearly sorted this but i think i need a MAX_Player or something as im getting a random number for score and money

Код:
stock PlayerGiveMoney(playerid, money) {
    PVar[playerid][pMoney] += money;
    GivePlayerMoney(playerid, PVar[playerid][pMoney]);
}
Код:
PlayerGiveMoney(playerid, pMoney);
Reply
#6

problem fixed.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)