SA-MP Forums Archive
Help Me About Stock - 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: Help Me About Stock (/showthread.php?tid=612964)



Help Me About Stock - alishvasis - 23.07.2016

Hi I'v Changed GivePlayerMoney To giveMoney But Give Me Many Errors Anyone can Fix It ? TnX

This Is My Stock
PHP код:
stock giveMoney(playeridamount)
{
    new 
msg[56];
    
KillTimer(Player[playerid][getTDtimer]);
    
Player[playerid][getTDtimer] = SetTimerEx("closeGetTD"5000false"d"playerid);
    
format(msgsizeof(msg), "+$%d"amount);
    
PlayerTextDrawSetString(playeridPlayer[playerid][getTD][0], msg);
    
PlayerTextDrawShow(playeridPlayer[playerid][getTD][0]);
    
Player[playerid][playerMoney] += amount;
    
ResetPlayerMoney(playerid);
    return 
GivePlayerMoney(playeridPlayer[playerid][playerMoney]);
}
stock takeMoney(playeridamount)
{
    new 
msg[56];
    
KillTimer(Player[playerid][getTDtimer]);
    
Player[playerid][getTDtimer] = SetTimerEx("closeGetTD"5000false"d"playerid);
    
format(msgsizeof(msg), "-$%d"amount);
    
PlayerTextDrawSetString(playeridPlayer[playerid][getTD][0], msg);
    
PlayerTextDrawShow(playeridPlayer[playerid][getTD][0]);
    
Player[playerid][playerMoney] -= amount;
    
ResetPlayerMoney(playerid);
    return 
GivePlayerMoney(playeridPlayer[playerid][playerMoney]);
}
stock updateMoney(playerid)
{
    
ResetPlayerMoney(playerid);
    return 
GivePlayerMoney(playeridPlayer[playerid][playerMoney]);

This Is My Error

Код HTML:
C:\Users\DashSalar\Desktop\top\California Cops and Robbers by Bondowocopz\filterscripts\kasino.pwn(12) : error 017: undefined symbol "Player"
C:\Users\DashSalar\Desktop\top\California Cops and Robbers by Bondowocopz\filterscripts\kasino.pwn(12) : warning 215: expression has no effect
C:\Users\DashSalar\Desktop\top\California Cops and Robbers by Bondowocopz\filterscripts\kasino.pwn(12) : error 001: expected token: ";", but found "]"
C:\Users\DashSalar\Desktop\top\California Cops and Robbers by Bondowocopz\filterscripts\kasino.pwn(12) : error 029: invalid expression, assumed zero
C:\Users\DashSalar\Desktop\top\California Cops and Robbers by Bondowocopz\filterscripts\kasino.pwn(12) : fatal error 107: too many error messages on one line



Re: Help Me About Stock - SyS - 23.07.2016

may be you mis typed your enum array can you show the enum?


Re: Help Me About Stock - alishvasis - 23.07.2016

Quote:
Originally Posted by Sreyas
Посмотреть сообщение
may be you mis typed your enum array can you show the enum?
I Dont HAve Enum . IThink My Stock Need Thats Please Give me Tnx

i'v Copied This Stock From Samp Whitout Enum


Re: Help Me About Stock - SyS - 23.07.2016

Quote:
Originally Posted by alishvasis
Посмотреть сообщение
I Dont HAve Enum . IThink My Stock Need Thats Please Give me Tnx

i'v Copied This Stock From Samp Whitout Enum
then show the decalaration of this matrix Player[MAX_PLAYER][idk_whats_here_since_u_have_no_enum]


Re: Help Me About Stock - alishvasis - 23.07.2016

Quote:
Originally Posted by Sreyas
Посмотреть сообщение
then show the decalaration of this matrix Player[MAX_PLAYER][idk_whats_here_since_u_have_no_enum]
Can You Give Me COmplet Of This Stock

I Need Change GivePlayerMoney To giveMoney


Re: Help Me About Stock - SyS - 23.07.2016

Now i understood you are copying pasting a script from other script. Thats why you are getting errors.these vars are not declared in your script.If you just want a raw function to change GivePlayerMoney to giveMoney you can either define a macro (which i wont recommend)
PHP код:
#define GivePlayerMoney giveMoney 
or write this function

PHP код:
giveMoney(playeridamount

     
    return 
GivePlayerMoney(playeridamount); 

Also you misinterepting the fact about functions


Re: Help Me About Stock - alishvasis - 23.07.2016

Quote:
Originally Posted by Sreyas
Посмотреть сообщение
Now i understood you are copying pasting a script from other script. Thats why you are getting errors.these vars are not declared in your script.If you just want a raw function to change GivePlayerMoney to giveMoney you can either define a macro (which i wont recommend)
PHP код:
#define GivePlayerMoney giveMoney 
or write this function

PHP код:
giveMoney(playeridamount

     
    return 
GivePlayerMoney(playeridamount); 

Also you misinterepting the fact about functions
Not Work ! Please Define My Stock


Re: Help Me About Stock - SyS - 23.07.2016

Quote:
Originally Posted by alishvasis
Посмотреть сообщение
Not Work ! Please Define My Stock
how come its not working you may not understood what is said.You DONT HAVE this 2d array in your code
PHP код:
Player[MAX_PLAYER][something_probably_enum_structure_name
and how come that will work on your script.Just tell me what you did with the code i posted above? and what is problem now?


Re: Help Me About Stock - alishvasis - 23.07.2016

Quote:
Originally Posted by Sreyas
Посмотреть сообщение
how come its not working you may not understood what is said.You DONT HAVE this 2d array in your code
PHP код:
Player[MAX_PLAYER][something_probably_enum_structure_name
and how come that will work on your script.Just tell me what you did with the code i posted above? and what is problem now?
Its Workeddd ! TnXXX BRo + REp