Need small help with PM
#10

Fixed:
PHP код:
CMD:pm(playerid,params[])  
    {  
        new 
targetidmsg[128];  
        if(
sscanf(params"us[128]"targetidmsg)) return SendClientMessage(playeridLIGHTBLUE,"[ USAGE: /pm (name/id) (Message) ]");  
        if(!
IsPlayerConnected(targetid)) return SendClientMessage(playeridred"[ ERROR: Player is not online! ]");  
        if(
pm[targetid] == false) return SendClientMessage(playeridred,"[ ERROR: Player has blocked private messages! ]");  
        if(
targetid == playerid) return SendClientMessage(playeridred"[ ERROR: You can't pm yourself! ]");  
        new 
string[128], Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];  
        
GetPlayerName(playeridName1sizeof(Name1));  
        
GetPlayerName(targetidName2sizeof(Name2));  
        
format(stringsizeof(string),"Private Message from %s (%d): %s"Name1playeridmsg);  
        
SendClientMessage(targetid,COLOR_PINKstring);  
        
format(stringsizeof(string),"Private Message sent to %s (%d): %s"Name2targetidmsg);  
        
SendClientMessage(playerid,COLOR_PINKstring);  
        new 
File:file=fopen("PM.log"io_append), hourminutesecondyearmonthday
        
gettime(hourminutesecond); 
        
getdate(yearmonthday); 
        
format(stringsizeof(string), "[%d/%d/%d, %d:%d:%d] %s to %s: %s\r\n"daymonthyearhourminutesecondName1Name2msg); 
        
fwrite(filestring);  
        
fclose(file);  
        return 
1;  

The title of this function in wiki https://sampwiki.blast.hk/wiki/Getdate is 'Getdate' but the real one is 'getdate' and 'gettime'.
Reply


Messages In This Thread
Need small help with PM - by Sc0pion - 13.03.2015, 15:01
Re: Need small help with PM - by ATGOggy - 13.03.2015, 15:16
Re: Need small help with PM - by Nabster - 13.03.2015, 15:19
Re: Need small help with PM - by Sc0pion - 13.03.2015, 15:27
Re: Need small help with PM - by ATGOggy - 13.03.2015, 15:32
Re: Need small help with PM - by Sc0pion - 13.03.2015, 15:35
Re: Need small help with PM - by ATGOggy - 13.03.2015, 15:40
Re: Need small help with PM - by Sc0pion - 13.03.2015, 15:48
Re: Need small help with PM - by Nabster - 13.03.2015, 15:49
Re: Need small help with PM - by ATGOggy - 13.03.2015, 15:51

Forum Jump:


Users browsing this thread: 1 Guest(s)