[Ayuda] stock & UserPath
#1

Hola a todos, buen dнa principalmente, hoy vengo con un nuevo problema.

Lo que pasa es que No se como solucionar el siguiente problema:

pawn Код:
#define UserPath   "%s.ini"

public OnPlayerDisconnect(playerid, reason){
    IfPlayerExist(playerid, UserPath);
}

stock IfPlayerExist(playerid, path)
{
    new PlayerName[MAX_PLAYERS], PrintPath[MAX_STRINGS]);
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName);
    format(PrintPath, sizeof(PrintPath), path, PlayerName);
    if(file(path)) SendClientMessage(playerid, COLOR_VERDE, string);
}
pasa que me avienta error en esta linea IfPlayerExist(playerid, UserPath); & dice:
Код:
argument type mismatch (argument 2)
como puedo usar UserPath en el stock?...
Reply
#2

ahh ya lo solucione, perdуn...
coloque los corchetes en el stock ([])
ejemplo:
pawn Код:
stock IfPlayerExist(playerid, path[])
{
    new PlayerName[MAX_PLAYERS], PrintPath[MAX_STRINGS]);
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName);
    format(PrintPath, sizeof(PrintPath), path, PlayerName);
    if(file(path)) SendClientMessage(playerid, COLOR_VERDE, string);
}

Gracias de todas formas
Reply
#3

Si lo que quieres es verificar que el nombre del jugador estб creado usa simplemente 'fexist'
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)