whats wrong
#1

stock ReturnPlayerID(PlayerName[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(strfind(pName(i),PlayerName,true)!=-1) return i;
}
}
return INVALID_PLAYER_ID;
}
Quote:

infernalRP.pwn(13027) : error 017: undefined symbol "pName"

Reply
#2

Your missing the variable "pName". Add this code at the top of your script:

pawn Код:
new pName[MAX_PLAYER_NAME];
Or right above your stock function.
Reply
#3

Perhaps ?

pawn Код:
new pName[24];
To late again.
Reply
#4

now i have these errors
Quote:

C:\Documents and Settings\Majdi Khammash\Desktop\samp03csvr_win32 (1)\gamemodes\infernalRP.pwn(1302 : error 012: invalid function call, not a valid address
C:\Documents and Settings\Majdi Khammash\Desktop\samp03csvr_win32 (1)\gamemodes\infernalRP.pwn(1302 : warning 215: expression has no effect
C:\Documents and Settings\Majdi Khammash\Desktop\samp03csvr_win32 (1)\gamemodes\infernalRP.pwn(1302 : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Majdi Khammash\Desktop\samp03csvr_win32 (1)\gamemodes\infernalRP.pwn(1302 : error 029: invalid expression, assumed zero

Reply
#5

We'll need to see a snippet of your code.

Post line 1295 - 1310 here
Reply
#6

1295-1310 is but it has notn to do with this part of code
Quote:

{
format(coordsstring, sizeof(coordsstring), "%d|%d|%d\r\n",
HouseCarInfo[idx][chEnable],
HouseCarInfo[idx][chCarInfo],
HouseCarInfo[idx][chHouseInfo]);

fwrite(file, coordsstring);
}
fclose(file);
}

SaveDealCars()
{
new coordsstring[256];
new File:file = fopen("dealcars.cfg", io_write);
for (new idx; idx < sizeof(DealCarInfo); idx++)

the place where im getting errors is where i posrted
Reply
#7

Hmm, I'm not too sure then . Sorry.
Reply
#8

Add this somewhere:
pawn Код:
stock pName(playerid)
{
    new
        iName[MAX_PLAYER_NAME];

    GetPlayerName(playerid, iName, sizeof(iName));
    return iName;
}
Reply
#9

thx that worked
Reply
#10

stock ReturnPlayerID(name[])
{
new fname[MAX_PLAYER_NAME];
for(new i = 0; i < GetMaxPlayers(); i++)if(IsPlayerConnected(i))
{
GetPlayerName(i, fname, MAX_PLAYER_NAME);
if(!strcmp(name,fname,false)) return i;
}
return INVALID_PLAYER_ID;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)