Problem with PM script
#7

Quote:
Originally Posted by Ken97
Посмотреть сообщение
This might help

PHP код:
new togglepm[MAX_PLAYERS],ID,message[128],str[128],Nam[MAX_PLAYER_NAME],Pname[MAX_PLAYER_NAME];
public 
OnPlayerConnect(playerid)
{
    
togglepm[playerid] = 1;
    return 
1;
}
CMD:pm(playeridparams[])
{
    if(
sscanf(params,"us",ID,message)) return SendClientMessage(playerid,0xF6BB0AA,"USAGE: /pm [ID] [message]");
    if(!
IsPlayerConnected(ID)) return SendClientMessage(playerid,0xFF0000FF,"Invalid ID");
    if(
togglepm[ID] == 0) return SendClientMessage(playerid,0xFB0000AA,"ERROR: That user has his pm toggled off");
    
GetPlayerName(ID,Pname,sizeof(Pname));
    
GetPlayerName(playerid,Nam,sizeof(Nam));
    
format(str,sizeof(str),">> %s(%d): %s",Pname,playerid,message);
    
SendClientMessage(playerid,0xFFFF00FF,str);
    
format(str,sizeof(str),"** %s(%d): %s",Nam,playerid,message);
    
SendClientMessage(ID,0xFFFF00FF,str);
    return 
1;
}
CMD:togglepm(playerid,params[])
{
    if(
togglepm[playerid] == 1)
    {
        
SendClientMessage(playerid,0xF6BB0AA,"You had toggled your pm OFF");
        
togglepm[playerid] = 0;
    }
    else if(
togglepm[playerid] == 0)
    {
        
SendClientMessage(playerid,0xF6BB0AA,"You had toggled your pm ON");
        
togglepm[playerid] = 1;
    }
    return 
1;

pawn Код:
#include <a_samp>
#include <sscanf2>
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define COLOUR_SYSTEM   0xB60000FF
#define COLOUR_PM       0xFFFF2AFF
#define COLOUR_INFO     0x00983BFF


new togglepm[MAX_PLAYERS],ID,message[128],str[128],Nam[MAX_PLAYER_NAME],Pname[MAX_PLAYER_NAME];

public OnPlayerConnect(playerid)
{
    togglepm[playerid] = 1;
    return 1;
}
CMD:pm(playerid, params[])
{
    if(sscanf(params,"us",ID,message)) return SendClientMessage(playerid,0xF6BB0AA,"USAGE: /pm [ID] [message]");
    if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,0xFF0000FF,"Invalid ID");
    if(togglepm[ID] == 0) return SendClientMessage(playerid,0xFB0000AA,"ERROR: That user has his pm toggled off");
    GetPlayerName(ID,Pname,sizeof(Pname));
    GetPlayerName(playerid,Nam,sizeof(Nam));
    format(str,sizeof(str),">> %s(%d): %s",Pname,playerid,message);
    SendClientMessage(playerid,0xFFFF00FF,str);
    format(str,sizeof(str),"** %s(%d): %s",Nam,playerid,message);
    SendClientMessage(ID,0xFFFF00FF,str);
    return 1;
}
CMD:togglepm(playerid,params[])
{
    if(togglepm[playerid] == 1)
    {
        SendClientMessage(playerid,0xF6BB0AA,"You had toggled your pm OFF");
        togglepm[playerid] = 0;
    }
    else if(togglepm[playerid] == 0)
    {
        SendClientMessage(playerid,0xF6BB0AA,"You had toggled your pm ON");
        togglepm[playerid] = 1;
    }
    return 1;
}
Errors:


C:\Documents and Settings\Nikos\ЕрйцЬнейб есгбуЯбт\samp server testing\filterscripts\nopm.pwn(29) : error 021: symbol already defined: "togglepm"
C:\Documents and Settings\Nikos\ЕрйцЬнейб есгбуЯбт\samp server testing\filterscripts\nopm.pwn(31) : error 010: invalid function or declaration
C:\Documents and Settings\Nikos\ЕрйцЬнейб есгбуЯбт\samp server testing\filterscripts\nopm.pwn(36) : error 010: invalid function or declaration
C:\Documents and Settings\Nikos\ЕрйцЬнейб есгбуЯбт\samp server testing\filterscripts\nopm.pwn(41) : error 010: invalid function or declaration
C:\Documents and Settings\Nikos\ЕрйцЬнейб есгбуЯбт\samp server testing\filterscripts\nopm.pwn(43) : warning 203: symbol is never used: "pm"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply


Messages In This Thread
Problem with PM script - by NickTaSpy - 24.05.2012, 14:36
Re: Problem with PM script - by Jstylezzz - 24.05.2012, 14:45
Re: Problem with PM script - by NickTaSpy - 24.05.2012, 14:49
Re: Problem with PM script - by Neil. - 24.05.2012, 14:51
Re: Problem with PM script - by NickTaSpy - 26.05.2012, 11:32
Re: Problem with PM script - by Neil. - 26.05.2012, 11:42
Re: Problem with PM script - by NickTaSpy - 26.05.2012, 20:26
Re: Problem with PM script - by Kirollos - 11.07.2012, 11:39

Forum Jump:


Users browsing this thread: 1 Guest(s)