GTAOnline.net
San Andreas Multiplayer (sa:mp) => Scripting SA-MP [Pawn center] => Discussion démarrée par: marsu le 02 Février 2008, 19:24:25
-
Voila ma creation parsque je mennuyai :)
if (strcmp(cmdtext, "/sms17", true) == 0) {
format(string, sizeof(string), "[ ! ]%s:Demande La Police (Son id: %d).", PlayerName, playerid);
SendClientMessage(PlayerName,giveplayerid, COLOR_RED1, string);
return 1;
}
Mais ya 1 erreur :(
error 035: argument type mismatch (argument 1)
-
J'imagine que tu veux envoyer un message aux policiers ?
-
Lol,
Tu met PlayerName, playerid sans l'avoir definie !
Aller je t'aide...
GetPlayerName(cherche pour la);
NV.
-
Ou je met le
GetPlayerName(cherche pour la);
? plz
-
Avant le message
NV.
-
Je voit toujour pas :(
un exemple stp
-
Aller moi je me lance je sui pas sur ses pas mon genre de commmande :
if (strcmp(cmdtext, "/sms17", true) == 0) {
GetPlayerName(player);
format(string, sizeof(string), "[ ! ]%s:Demande La Police (Son id: %d).", PlayerName, playerid);
SendClientMessage(PlayerName,giveplayerid, COLOR_RED1, string);
return 1;
}
-
Non c'est pas sa mais sa ressemble
if (strcmp(cmdtext, "/sms17", true) == 0) {
GetPlayerName(player,giveplayerid,playerid);
format(string, sizeof(string), "[ ! ]%sQuelqu'un Demande La Police (Son id: %d).",playerid);
SendClientMessage(giveplayerid, COLOR_RED1, string);
return 1;
}
erreur
error 017: undefined symbol "player"
-
Voila...
if (strcmp(cmdtext, "/sms17", true) == 0) {
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "[ ! ] %s: Demande La Police (Son id: %d).", PlayerName, playerid);
SendClientMessage(PlayerName,giveplayerid, COLOR_RED1, string);
return 1;
}
J'ai pas tester !
NV.
-
preske :(
error 017: undefined symbol "PlayerName"
error 017: undefined symbol "PlayerName"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Avec ton code jai mis new PlayerName;
Est voila
warning 225: unreachable code
argument type mismatch (argument 2)
error 035: argument type mismatch (argument 2)
error 035: argument type mismatch (argument 3)
-
Quel endouille que je suis !
if (strcmp(cmdtext, "/sms17", true) == 0) {
new PlayerName[MAX_PLAYER_NAME];
new string[256];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "[ ! ] %s: Demande La Police (Son id: %d).", PlayerName, playerid);
SendClientMessage(PlayerName,giveplayerid, COLOR_RED1, string);
return 1;
}
NV.
-
Toujour pas
D:\PROGRA~1\ROCKST~1\GTASAN~1\FILTER~1\sad.pwn(140) : warning 225: unreachable code
D:\PROGRA~1\ROCKST~1\GTASAN~1\FILTER~1\sad.pwn(183) : warning 219: local variable "PlayerName" shadows a variable at a preceding level
D:\PROGRA~1\ROCKST~1\GTASAN~1\FILTER~1\sad.pwn(184) : warning 219: local variable "string" shadows a variable at a preceding level
D:\PROGRA~1\ROCKST~1\GTASAN~1\FILTER~1\sad.pwn(187) : error 035: argument type mismatch (argument 1)
D:\PROGRA~1\ROCKST~1\GTASAN~1\FILTER~1\sad.pwn(179) : warning 203: symbol is never used: "PlayerName"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
-
C'est quel ligne le "187" ?
-
Une des lignes des command /sms17
-
tien je chercher aussi un peux prés une commandes comme ça mais saufe pas pour la police :jesors
-
Bon Marsu, va falloir réfléchir un peu de ton coté sinon ce post ne va plus en finir.
D:\PROGRA~1\ROCKST~1\GTASAN~1\FILTER~1\sad.pwn(140) : warning 225: unreachable code
-> Ca ça veut dire que la ligne 140 (et les suivantes) ne seront JAMAIS exécutées.
Solution : Tu dois avoir un return avant, déplace le après ta commande (mais ce warning ne concerne peut-être pas ta commande /sms17)
D:\PROGRA~1\ROCKST~1\GTASAN~1\FILTER~1\sad.pwn(183) : warning 219: local variable "PlayerName" shadows a variable at a preceding level
-> Ca, ça veut dire que le variable "PlayerName" est déjà définie quelque part dans ton script
Solution : Supprime la ligne 183
D:\PROGRA~1\ROCKST~1\GTASAN~1\FILTER~1\sad.pwn(184) : warning 219: local variable "string" shadows a variable at a preceding level
-> Ca, ça veut dire que le variable "string" est déjà définie quelque part dans ton script
Solution : Supprime la ligne 184
D:\PROGRA~1\ROCKST~1\GTASAN~1\FILTER~1\sad.pwn(187) : error 035: argument type mismatch (argument 1)
-> Ca ça veut dire que l'argument 1 (PlayerName) de la fonction SendClientMessage n'a pas le bon type
Solution : Le premier argument (paramètre) de la fonction SendClientMessage est un ID de joueur, pas un nom donc remplace PlayerName par playerid.
D:\PROGRA~1\ROCKST~1\GTASAN~1\FILTER~1\sad.pwn(179) : warning 203: symbol is never used: "PlayerName"
-> Ce warning va disparaitre lorsque tu auras supprimé la ligne 183.
++
Syg