/me command errors
#1

i have some errors when i use this script
PHP код:
CMD:me(playerid, params[])
{
    new 
string[128], action[100];
    if(
sscanf(params, "s[100]", action))
    {
        
SendClientMessage(playerid, 0xAA3333AA, "[ERREUR]Utilise : /me [action]");
        return 
1;
    }
    else
    {
        
format(string, sizeof(string), "* %s %s", GetName(playerid), action);
        
ProxDetector(30, playerid, string, 0xC2A2DAAA);
    }
    return 
1;
} 
my includes :
PHP код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <foreach> 
my errors :
Код:
C:\Users\mickael\Desktop\Serveur SCP\gamemodes\SCPRP.pwn(193) : error 017: undefined symbol "GetName"
C:\Users\mickael\Desktop\Serveur SCP\gamemodes\SCPRP.pwn(194) : error 017: undefined symbol "ProxDetector"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
thank for the help
Reply
#2

PHP код:
CMD:me(playerid, params[])
{
    new
        
name    [ MAX_PLAYER_NAME ],
        
string    [ 128 ],
        
action    [ 100 ];
        
    if(
sscanf(params, "s[100]", action)) {
        
SendClientMessage(playerid, 0xAA3333AA, "[ERREUR]Utilise : /me [action]");
        return 
1;
    }
    else {
        
GetPlayerName(playerid, name, sizeof(name));
        
format(string, sizeof(string), "* %s %s", name, action);
        
SendClientMessage(playerid, -1, string);
    }
    return 
1;
} 
Reply
#3

No...

You haven't got ProxDetector or GetName defined in your script.
Reply
#4

Quote:
Originally Posted by luke49
Посмотреть сообщение
PHP код:
CMD:me(playerid, params[])
{
    new
        
name    [ MAX_PLAYER_NAME ],
        
string    [ 128 ],
        
action    [ 100 ];
        
    if(
sscanf(params, "s[100]", action)) {
        
SendClientMessage(playerid, 0xAA3333AA, "[ERREUR]Utilise : /me [action]");
        return 
1;
    }
    else {
        
GetPlayerName(playerid, name, sizeof(name));
        
format(string, sizeof(string), "* %s %s", name, action);
        
SendClientMessage(playerid, -1, string);
    }
    return 
1;
} 
This is not correct, it will send message to the playerid.

btw the problem is because you didn't define those 2 functions

PHP код:
stock GetName(playerid)
{
    new 
playername[MAX_PLAYER_NAME];
    
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
    return 
playername;
}
stock ProxDetector(Float:arearadi, playerid, const string[],color)
{
    new 
Float:x,
        
Float:y,
        
Float:z;
    
GetPlayerPos(playerid,x,y,z);
    foreach(new 
i: Player) {
        if(
IsPlayerInRangeOfPoint(i,arearadi,x,y,z))
        {
            
SendClientMessage(i,color,string);
        }
    }
} 
Reply
#5

oh thank you that a stupid errors
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)