SA-MP Forums Archive
whats wrong - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: whats wrong (/showthread.php?tid=236098)



whats wrong - farris - 06.03.2011

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"




Re: whats wrong - grand.Theft.Otto - 06.03.2011

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.


Re: whats wrong - Stigg - 06.03.2011

Perhaps ?

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


Re: whats wrong - farris - 06.03.2011

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




Re: whats wrong - grand.Theft.Otto - 06.03.2011

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

Post line 1295 - 1310 here


Re: whats wrong - farris - 06.03.2011

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


Re: whats wrong - grand.Theft.Otto - 06.03.2011

Hmm, I'm not too sure then . Sorry.


Re: whats wrong - [L3th4l] - 06.03.2011

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

    GetPlayerName(playerid, iName, sizeof(iName));
    return iName;
}



Re: whats wrong - farris - 06.03.2011

thx that worked


Re: whats wrong - GameStar. - 06.03.2011

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;
}