Easy question; GetPlayerID [REP+]
#1

Here's the code
PHP код:
stock GetPlayerID(Name[])
{
    new 
pName[24];
    for(new 
0MAX_PLAYERSi++)
    {
        
GetPlayerName(ipNamesizeof(pName));
        if(
strcmp(NamepNametrue)==0)
        {
            return 
i;
        }
    }
    return 
1;

Errors

PHP код:
C:\Users\zero\Downloads\samp037_svr_R1_win32 (1)aa\gamemodes\FAKE.pwn(527) : warning 219local variable "Name" shadows a variable at a preceding level
C
:\Users\zero\Downloads\samp037_svr_R1_win32 (1)aa\gamemodes\FAKE.pwn(533) : error 035argument type mismatch (argument 1
The first error line
PHP код:
stock GetPlayerID(Name[]) 
Second error
PHP код:
if(strcmp(NamepNametrue)==0
Reply
#2

Try change Name into NAME
Reply
#3

https://sampforum.blast.hk/showthread.php?tid=570927
Reply
#4

Quote:
Originally Posted by Vince
Посмотреть сообщение
Can you do it in sscanf for me?
Reply
#5

It says that the word " Name " is already use , chane it to something else like name1 , name2 ..
. So on
Reply
#6

pawn Код:
GetPlayerID(Name[])
{
       new giveplayerid;
       sscanf(Name, "u", giveplayerid);
       return giveplayerid;
}
Or as a macro:

pawn Код:
#define GetPlayerID(%0) \
        sscanf(%0, "u", %0); \
           return %0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)