/pm = crashing server
#1

pawn Код:
dcmd_pm(playerid, params[])
{
    new targetid;
    new string[128];
    new message[128];
    if(sscanf(params,"uz",targetid,message)) return SM(playerid,red,"Error: /pm [id/name] [message]");
   
    format(string, sizeof(string),"PM: %s(id: %d): %s",gPlayer[playerid][gName],message);
    SendClientMessage(targetid,PLAYER_COLOR_YELLOW,string);
    return 1;
}
When typing /pm it will crash the server.
Reply
#2

pawn Код:
format(string, sizeof(string),"PM: %s(id: %d): %s",gPlayer[playerid][gName],message);
//you only defined name & message not the id.
//Although i don't know if that can crash the server.
Reply
#3

Quote:
Originally Posted by Mikkel_Pedersen
Посмотреть сообщение
pawn Код:
format(string, sizeof(string),"PM: %s(id: %d): %s",gPlayer[playerid][gName],message);
//you only defined name & message not the id.
//Although i don't know if that can crash the server.
Yes, this crashes the server.

pawn Код:
format(string, sizeof(string),"PM: %s(id: %d): %s",gPlayer[playerid][gName], playerid, message);
//Use that line, I added the playerid to the params
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)