25.03.2012, 13:31
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
Here's my script.
The top :
And the script :
Thanks for helping.
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.
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
PHP код:
stock ProxDetector(Float:radi, playerid, len[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid)) {
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))) {
if(!BigEar[i]) {
GetPlayerPos(i, posx, posy, posz);
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(i, col1, len);
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8))) SendClientMessage(i, col2, len);
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4))) SendClientMessage(i, col3, len);
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2))) SendClientMessage(i, col4, len);
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) SendClientMessage(i, col5, len);
} else {
SendClientMessage(i, col1, len);
}
}
}
}
return 1;
}
new string[256];
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/cligon", cmdtext, true, 10) == 0)
{
format(string, sizeof(string), "%s viens d'activer/dйsactiver ses clignotants", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_GREEN, "Clignotant dйsactivй/activй");
Delete3DTextLabel(gauche[playerid]);
Delete3DTextLabel(droite[playerid]);
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_LEFT))
{
SendClientMessage(playerid, COLOR_YELLOW, "Vous mettez les clignotants gauche");
format(string, sizeof(string), "** %s met son clignotant gauche..", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
gauche[playerid] = Create3DTextLabel("<<== Clignotant gauche <<==",0x008B00FF,0,0,0,50,-1,1);
Attach3DTextLabelToPlayer(gauche[playerid], playerid, 0,0,0);
return 1;
}
if (PRESSED(KEY_RIGHT))
{
SendClientMessage(playerid, COLOR_YELLOW, "Vous mettez les clignotants droite");
format(string, sizeof(string), "** %s met son clignotant droite..", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
droite[playerid] = Create3DTextLabel("==>> Clignotant droite ==>>",0x008B00FF,0,0,0,50,-1,1);
Attach3DTextLabelToPlayer(gauche[playerid], playerid, 0,0,0);
return 1;
}
return 0;
}
Thanks for helping.