GTAOnline.net
San Andreas Multiplayer (sa:mp) => Scripting SA-MP [Pawn center] => Discussion démarrée par: leptiroman le 23 Août 2009, 02:12:27
-
Bonsoir comment aller vous?
Alors voila pour une foi ma demande est simple. mais se compose en 2 parties.
1* j'aimerai mettre une commande du genre /spec (être en spectateur, genre /tv mais pour les admins) un /sepc utilisable par les admin, mai spas seulement les admins en Rcon mais a partir de l'admin 1.
2* j'aimerai que toute les commande admin que els admin utilise , les autres admins connecte puise avoir une tite phrase genre * admin [pseudo] a utiliser la commande [ nom de la commande]
merci bcp d'avance. j'ai chercher un peu partout mais pas trouver merci beaucoup.
A très bientôt.
-
pour le massage tu peu regarder au niveau du script admin de r@f ou dans la partit script utiles le SendAdminMessage pour le /spec pour les admins reprend celui fournit avec le serveur lorsque tu le telecharge puis incorpore le dans le GM puis a la place de if(IsPlayerAdmin(playerid) remplace par if(playerinfo [playerid][admin] !=0) <=== donner a titre indicatif ;)
-
Il faudrait aussi que tu nous dise quel FS et quel GM tu utilise ! ;)
-
yah00078 , j'utilise une base de GF et les sript admin j'en utilise aps c'etsles cmd d'origine ou des que j'ai inclu dedans
cristab, pour le /spec pour les admins reprend celui fournit avec le serveur lorsque tu le telecharge puis incorpore le dans le GM puis a la place de if(IsPlayerAdmin(playerid) remplace par if(playerinfo [playerid][admin] !=0) <=== donner a titre indicatif
heu je comprend pas , la,.... le spec qu'on telecharge il est en FS et donne ça :
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new specplayerid, specvehicleid, idx;
// WE ONLY DEAL WITH COMMANDS FROM ADMINS IN THIS FILTERSCRIPT
if(playerinfo [playerid][admin] >= 1) return 0;
cmd = adminspec_strtok(cmdtext, idx);
// SPECTATE A PLAYER
if(strcmp(cmd, "/spec", true) == 0) {
new tmp[256];
tmp = adminspec_strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /spec [playerid]");
return 1;
}
specplayerid = strval(tmp);
if(!IsPlayerConnected(specplayerid)) {
SendClientMessage(playerid, COLOR_RED, "specplayer: that player isn't active.");
return 1;
}
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, specplayerid);
SetPlayerInterior(playerid,GetPlayerInterior(specplayerid));
gSpectateID[playerid] = specplayerid;
gSpectateType[playerid] = ADMIN_SPEC_TYPE_PLAYER;
return 1;
}
mais si je remplace y a des erreurs ...
pour le SendAdminMessage bah je trouve pas, ça fonctionne pas
:( :wall
-
Si c'est sur une base du GF, tu dois avoir normalement une ligne:
ABroadCast(COLOR_YELLOW,string,1);
C'est cette ligne qui te permet d'envoyer un message aux admins/modos uniquement
Un petit "format" avant avec la phrase ça devrait fonctionner ;)
-
pour le SendAdminMessage
SendAdminMessage(couleur, text[])
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerAdmi(i))
{
SendClientMessage(i,couleur,text);
}
}
}
Pour donc faire une phrase comme tu veut pour les admin
SendAdminCmd(cmd[])
{
new CMS[128];
format(CMS, sizeof(CMS), "l'admin %s vient de taper cette commande: %s", (nomplayerid),cmd);
for (new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerAdmi(i))
{
SendClientMessage(i,COLOR_GREEN,CMS);
}
}
}
stock nom(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
return name;
}
puis dans le onplayercommandetext
rajoute
if(playerinfo [playerid][admin] != 0)
{
SendAdminCmd(cmdtext);
}
Voila j'ai rien tester mais sa doit fonctionner au pire si il y a des erreures tu devrais les trouver
PS j'ai oublier de te parler de ceci SendAdminMessage(couleur, text[])
tu peu l'utiliser comme bon te semble de cette maniere
SendAdminMessage(COLOR_RED, "comment sa va");
++
-
cristab je t'aime !
par contre j'ai resolu qqu erreur mais la je sais pu:
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(7840) : error 017: undefined symbol "SendAdminCmd"
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(7851) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(7859) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(7865) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(7870) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(7879) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(7923) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(7934) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(7939) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(7945) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(7950) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(7960) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(7976) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(7988) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(7995) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(8007) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(8014) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(8026) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(8033) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(8095) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(8108) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(8115) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(8126) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(8133) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(8146) : error 079: inconsistent return types (array & non-array)
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(8167) : error 079: inconsistent return types (array & non-array)
-
sa ressemble a une accolade manquante de fermeture ou il manque un return 1; ici
if(playerinfo [playerid][admin] != 0)
{
SendAdminCmd(cmdtext);
return 1;
}
-
heu en fait ça change rien reste toujours
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(7840) : error 017: undefined symbol "SendAdminCmd"
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(7841) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(7852) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(7860) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(7866) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(7871) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(7880) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(7924) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(7935) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(7940) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(7946) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(7951) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(7961) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(7977) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(7989) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(7996) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(8008) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(8015) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(8027) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(8034) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(8096) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(8109) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(8116) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(8127) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(8134) : error 079: inconsistent return types (array & non-array)
C:\PROGRA~1\ROCKST~1\GTASAN~1\LEPTIR~1\GAMEMO~1\LEPTIR~1.PWN(8147) : error 079: inconsistent return types (array & non-array)
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
26 Errors.
-
error 017: undefined symbol "SendAdminCmd"
Doit te manquer un define ;)
Sinon comme je l'ai dit dans mon 1er message, si t'utilises une base de GF tu dois avoir la fonction déjà implantée sous le format
ABroadCast(COLOR_YELLOW,string,1);
-
ll je rajoute juste #define SendMessageAdmin ?
heu le
ABroadCast(COLOR_YELLOW,string,1);
comment j'utilise ça?
-
heu le
ABroadCast(COLOR_YELLOW,string,1);
comment j'utilise ça?
Comme sa :
ABroadCast(LA_COULEUR,LE_TEXTE);
Voila
++
-
ouais merci j'avais compris ça lol, c'est pas grave, vais utiliser la technique de cristab, mais encore qque erreur a corriger et ça devrai etre bon si il pouvais se manifester,... ça serai extra:)
-
désolé du doublle post mais quelqun a t'il un idée?
-
A part le système que je t'ai dit que j'utiliser sur mon serveur je vois pas désolé :'(
-
Autres manière, tu fait toi même la fonction. Une boucle qui va parcourir chaque joueur et vérifier s'ils sont admin et si c'est le cas ben t'envoie un
simple SendClientMessage.
Petit exemple :
for(new i=0; i<MAX_PLAYERS; i++)
{
if(LE JOUEUR EST ADMIN)
{
new str[100];
format(str, sizeof(str), "L'admin %s à utiliser la cmd %s" nom de l admin qu'a fait la commande, nom de la comande);
}
}
Voila, donc le "LE JOUEUR EST ADMIN" tu le remplace par ta manière de savoir si le joueur est admin (je sait pas si tous les admins de ton serveur son en rcon).
nom de l admin qu'a fait la commande : Sa le nom de l admin qui fait la cmd que tu auras récuperer avec GetPlayerName. (La flemme de le faire dans le code).
nom de la comande : Nom de la commande ( tu peut mettre directement cmdtext si tu est dans OnPlayerCommandText).
Voila je crois avoir rien oublier.
++
-
génial je vais tenté ça merci.