problem with ,,new''
#1

PHP код:
stock GivePlayerItem(playerid,legalitem,item,ammount,percent)
{
    new 
item random(ammount);
    switch (
random(percent))
    {
        case 
01:
        {
        
RLTnfo[playerid][legalitem] += item;
        
metal += item;
    new 
rep[128];
    
format (repsizeof(rep), "Found Metal %d",item);
    
SendClientMessage(playeridCOLOR_LIGHTBLUE"Scavenge Report:");
    
SendClientMessage(playeridCOLOR_LIGHTBLUErep);
        }
    }
    return 
0;

How can replace a
PHP код:
new item random (amount
; by Index Stock Index by itself 3 "item" to make the same function as the new item ...
Reply
#2

****** translate...
Reply
#3

No Bulgarian section
Reply
#4

I just want to know how to do,, item'' himself Stock receive constant number generated by the random and it introduces the 3 places
Reply
#5

....
Reply
#6

AFP can not explain what I want to do just what I want ,,fmetal'' from
PHP код:
GivePlayerItem (playeridMetalfmetal10,2); 
just replace this
PHP код:
new item random (amount); 
but when out of
PHP код:
stock GivePlayerItem (playeridlegalitemitemamountpercent

eg write testmetal and I very,, item'' from Stock to replace just that,, item'' of
PHP код:
new item.... 
gives me Warnings which provide a top

I just want this to be
PHP код:
 new 
with a different name every time he enters the third parameter to the function
Reply
#7

"item" is a defined symbol and it's a parameter of GivePlayerItem function. By declaring "item" as a new variable will give you the warnings.

If you want to store the value of a random amount to a variable, then use another name other than "item" for it.
Reply
#8

Yeah but that's the work that you have for each subject to make separate Function examples should do 15 function GivePlayerMetal, GivePlayerWood and each is different,, new''

Is there no way just by himself Stock to enter any keyword that can be used the same as new to store the number of random
Reply
#9

This is my new project that go from house to house searching for supplies such as metal, wood, cloth and other work with them to produce different things and this is my Stock system that gives you different chances to find something different and the amount of it I hope you understand it
Reply
#10

As ****** said you're confusing between a stock and a function.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)