OnPlayerKeyStateChange Problem
#1

Hello,

Well i've got a little problem when i try to add a script when you press on a KeyBoard key it does the action. Sorry for bad english ^^


Here's my compile

Код:
I:\Users\Misume\Documents\samp03dsvr_R2_win32\filterscripts\clig.pwn(103) : error 029: invalid expression, assumed zero
I:\Users\Misume\Documents\samp03dsvr_R2_win32\filterscripts\clig.pwn(103) : error 004: function "OnPlayerKeyStateChange" is not implemented
I:\Users\Misume\Documents\samp03dsvr_R2_win32\filterscripts\clig.pwn(105) : error 029: invalid expression, assumed zero
I:\Users\Misume\Documents\samp03dsvr_R2_win32\filterscripts\clig.pwn(115) : error 029: invalid expression, assumed zero
I:\Users\Misume\Documents\samp03dsvr_R2_win32\filterscripts\clig.pwn(130) : error 030: compound statement not closed at the end of file (started at line 93)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Here's my script.
The top :

PHP код:
 #define FILTERSCRIPT
    #include <a_samp>
    #include <a_players>
    
    #define PRESSED(%0)
    #define newkeys(%0)
    #define oldkeys(%0)
    
    #define COLOR_YELLOW 0xFFFF00AA
    #define COLOR_WHITE 0xFFFFFFAA
    #define COLOR_GREEN 0x33AA33AA
    #define COLOR_PURPLE 0xB462F6F6
    #define MAX_STRING 255
    
    
new sendername;
    new 
Text3D:gauche[MAX_PLAYERS];
    new 
Text3D:droite[MAX_PLAYERS];
    new 
BigEar[MAX_PLAYERS];
    
    
#if defined FILTERSCRIPT
    #pragma tabsize 0 
And the script :

PHP код:
stock ProxDetector(Float:radiplayeridlen[],col1,col2,col3,col4,col5)
{
    if(
IsPlayerConnected(playerid)) {
        new 
Float:posxFloat:posyFloat:posz;
        new 
Float:oldposxFloat:oldposyFloat:oldposz;
        new 
Float:tempposxFloat:tempposyFloat:tempposz;
        
GetPlayerPos(playeridoldposxoldposyoldposz);
        for(new 
0MAX_PLAYERSi++) {
            if(
IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))) {
                if(!
BigEar[i]) {
                    
GetPlayerPos(iposxposyposz);
                    
tempposx = (oldposx -posx);
                    
tempposy = (oldposy -posy);
                    
tempposz = (oldposz -posz);
                    if (((
tempposx radi/16) && (tempposx > -radi/16)) && ((tempposy radi/16) && (tempposy > -radi/16)) && ((tempposz radi/16) && (tempposz > -radi/16))) SendClientMessage(icol1len);
                    else if (((
tempposx radi/8) && (tempposx > -radi/8)) && ((tempposy radi/8) && (tempposy > -radi/8)) && ((tempposz radi/8) && (tempposz > -radi/8))) SendClientMessage(icol2len);
                    else if (((
tempposx radi/4) && (tempposx > -radi/4)) && ((tempposy radi/4) && (tempposy > -radi/4)) && ((tempposz radi/4) && (tempposz > -radi/4))) SendClientMessage(icol3len);
                    else if (((
tempposx radi/2) && (tempposx > -radi/2)) && ((tempposy radi/2) && (tempposy > -radi/2)) && ((tempposz radi/2) && (tempposz > -radi/2))) SendClientMessage(icol4len);
                    else if (((
tempposx radi) && (tempposx > -radi)) && ((tempposy radi) && (tempposy > -radi)) && ((tempposz radi) && (tempposz > -radi))) SendClientMessage(icol5len);
                } else {
                    
SendClientMessage(icol1len);
                }
            }
        }
    }
    return 
1;
}
 new 
string[256];
 public 
OnPlayerCommandText(playeridcmdtext[])
{
        if (
strcmp("/cligon"cmdtexttrue10) == 0)
        {
                    
format(stringsizeof(string), "%s viens d'activer/dйsactiver ses clignotants"sendername);
                    
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    
SendClientMessage(playeridCOLOR_GREEN"Clignotant dйsactivй/activй");
                            
Delete3DTextLabel(gauche[playerid]);
                            
Delete3DTextLabel(droite[playerid]);
                            return 
1;
}
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if (
PRESSED(KEY_LEFT))
    {
                            
SendClientMessage(playeridCOLOR_YELLOW"Vous mettez les clignotants gauche");
                            
format(stringsizeof(string), "** %s met son clignotant gauche.."sendername);
                            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                            
gauche[playerid] = Create3DTextLabel("<<== Clignotant gauche <<==",0x008B00FF,0,0,0,50,-1,1);
                            
Attach3DTextLabelToPlayer(gauche[playerid], playerid0,0,0);
                            return 
1;
                            }
    if (
PRESSED(KEY_RIGHT))
    {
                             
SendClientMessage(playeridCOLOR_YELLOW"Vous mettez les clignotants droite");
                            
format(stringsizeof(string), "** %s met son clignotant droite.."sendername);
                            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                            
droite[playerid] = Create3DTextLabel("==>> Clignotant droite ==>>",0x008B00FF,0,0,0,50,-1,1);
                            
Attach3DTextLabelToPlayer(gauche[playerid], playerid0,0,0);
                            return 
1;
                    }
            return 
0;
        } 

Thanks for helping.
Reply


Messages In This Thread
OnPlayerKeyStateChange Problem - by Mearu - 25.03.2012, 13:31
Re: OnPlayerKeyStateChange Problem - by [MG]Dimi - 25.03.2012, 13:58
Re : OnPlayerKeyStateChange Problem - by Mearu - 25.03.2012, 14:06
Re: OnPlayerKeyStateChange Problem - by emokidx - 25.03.2012, 14:21
Re : OnPlayerKeyStateChange Problem - by Mearu - 25.03.2012, 15:06
Re: Re : OnPlayerKeyStateChange Problem - by 2KY - 25.03.2012, 15:10

Forum Jump:


Users browsing this thread: 1 Guest(s)