• 19 Avril 2024, 08:10:45


Auteur Sujet: Demande aide  (Lu 1623 fois)

0 Membres et 1 Invité sur ce sujet

Hors ligne .:: Miguel .::

  • *
  • Tueur en série
  • Messages: 206
    • Voir le profil
Demande aide
« le: 03 Juin 2011, 19:09:37 »
Salut,
J'ai un problème quand j'ai mis la cmds /(
C:\Users\Miguel\Desktop\france rôle plau\gamemodes\FR-RP.pwn(134) : error 017: undefined symbol "sendername"
C:\Users\Miguel\Desktop\france rôle plau\gamemodes\FR-RP.pwn(134) : error 017: undefined symbol "sendername"
C:\Users\Miguel\Desktop\france rôle plau\gamemodes\FR-RP.pwn(134) : error 029: invalid expression, assumed zero
C:\Users\Miguel\Desktop\france rôle plau\gamemodes\FR-RP.pwn(134) : fatal error 107: too many error messages on one line


les cmds
  if(strcmp(cmd, "/(", true) == 0 || strcmp(cmd, "/b", true) == 0)//local ooc
{
    if(IsPlayerConnected(playerid))
    {
        if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid,ROUGE, "Vous n'êtes pas loggué!");
            return 1;
        }
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_BLANC, "USAGE: /( <text>");
return 1;
}
if(PlayerInfo[playerid][pMaskuse] == 1)
{
    format(string, sizeof(string), "(( Etranger dit:  %s ))", result);
}
else
{
format(string, sizeof(string), "(( [%i] %s dit: %s ))", playerid, sendername, result);
}
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
printf("%s", string);
}
return 1;
}
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
public ProxDetector(Float:radi, playerid, string[],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, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, string);
}
}
else
{
SendClientMessage(i, col1, string);
}
}
}
}
return 1;
}



Hors ligne Ssk

  • *
  • Lulu's Stunt - Le serveur stunt de Lulu !
  • Messages: 8154
    • Voir le profil
Re : Demande aide
« Réponse #1 le: 03 Juin 2011, 19:28:05 »
Ta commande est tellement horrible que j'ai été obligé de te la recoder !
à tester

if( strcmp( "/(", cmdtext, true, 2 ) == 0 || strcmp( "/b", cmdtext, true, 2 ) )
{
if( gPlayerLogged[ playerid ] == 0 ) return SendClientMessage( playerid, ROUGE, "Vous n'êtes pas loggé" );
new tmp[ MAX_PLAYERS_NAME ] = "", str[128] = "";

if( strlen( cmdtext[2] ) == 0 ) return SendClientMessage( playerid, ROUGE, "UTILISATION: /( <texte>");
if(PlayerInfo[playerid][pMaskuse] == 1)
{
format(str, 128, "(( Etranger dit:%s ))", cmdtext[2] );
}
else
{
GetPlayerName( playerid, tmp, MAX_PLAYERS_NAME );
format(str, 128, "(( [%i] %s dit:%s ))", playerid, tmp, cmdtext[2]);
}
ProxDetector(20.0, playerid, str,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
printf("%s", str);
return 1;
}



Derrière tout programme se cache un programmeur, je considère le monde comme un programme.
Mon blog