11.06.2012, 20:22
I need to get specific player's ID from their name. Now I don't know what seems to be the problem, but I still get an error.
So here's the function:
Here is where I'm trying to use it:
Here is the error:
I'm basically trying to make it so, that when someone uses the bank, the owner gets 25 dollars from the user's 'pocket'.
So here's the function:
pawn Код:
stock GetPlayerId(Name[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new pName2[MAX_PLAYER_NAME];
GetPlayerName(i, pName2, sizeof(pName2));
if(!strcmp(Name, pName2))
{
return i;
}
}
}
return -1;
}
pawn Код:
new manager;
manager = GetPlayerId(Allen_Blaxland[]);
GivePlayerCash(manager, 25);
GivePlayerCash(playerid, -25);
SendClientMessage(playerid, COLOR_WHITE, "{CC3333}NOTICE: {ffffff}You have paid $25 for using the bank.");
pawn Код:
error 017: undefined symbol "Allen_Blaxland"