06.05.2011, 03:36
pawn Код:
dcmd_dardinero(playerid, params[]) //Fuera de cualquier callback, NUNCA dentro de OnPlayerCommandText, puedes ponerlo justo encima
{
new pid; //Le he llamado PID
new dinero; //Nuevo
if(Info[playerid][Nivel] == 5) //Perfecto
{
if(sscanf(params,"ui", pid, dinero) ) return SendClientMessage(playerid, COLOR_ROJO, "ERROR: usa /dardinero (playerid) (cantidad)");
if(IsPlayerConnected(pid))
{
GivePlayerMoney(pid, dinero); //Esto estaba mal, era mas simple
} else return SendClientMessage(playerid, COLOR_ROJO, "ERROR: Jugador no conectado");
}
else
{
SendClientMessage(playerid,COLOR_ROJO,Errornivel3);
}
return 1;
}
