[Ajuda] passar string por parametro
#1

Queria passar por parametro funзхes com strings, como essas que estгo dando errado:
PHP Code:
GetPlayerLevel(playerid"lvl");
if(
skillid == "lvl"skillid experience[playerid]; 
Nгo da pra fazer isso?


Exemplos:
PHP Code:
if(skillid == "lvl"skillid experience[playerid]; 
PHP Code:
stock GetPlayerLevel(playeridskillid) {
    new 
lvl 1;
    if(
skillid == "lvl"skillid experience[playerid];
    else if(
skillid == "mecanic"skillid MECANICskills[playerid];
    new 
nextlvl GetPlayerExpToNextLVL(lvl);
    while(
skillid >= nextlvl) {
        
skillid -= nextlvl;
        
lvl++;
        
nextlvl GetPlayerExpToNextLVL(lvl);
    }
    return 
lvl;

Reply
#2

Use strcmp para comparar strings.

E tambйm, faзa assim:
PHP Code:
stock GetPlayerLevel(playeridskillid[]) 
Reply
#3

Quote:
Originally Posted by ipsLuan
View Post
Use strcmp para comparar strings.

E tambйm, faзa assim:
PHP Code:
stock GetPlayerLevel(playeridskillid[]) 
Pdc, vlw +REP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)