GTAOnline.net

San Andreas Multiplayer (sa:mp) => Scripting SA-MP [Pawn center] => Discussion démarrée par: .:: Miguel .:: le 11 Juin 2011, 21:48:45

Titre: Problème /heal
Posté par: .:: Miguel .:: le 11 Juin 2011, 21:48:45
Salut,
J'ai pas trop bien compris la fonction strtok donc j'ai voulu créé la cmds /heal et sa me met des erreur
C:\Users\Miguel\Desktop\CS\gamemodes\CS.pwn(310) : error 035: argument type mismatch (argument 2)
if(strcmp(cmd, "/heal", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
return SendClientMessage(playerid, COLOR_YELLOW, "USAGE : /heal [ID]");
}
new playa = strval(tmp);
        if(IsPlayerConnected(playa))
    {
GetPlayerHealth(playa,100);
}
return 1;
}
}


Titre: Re : Problème /heal
Posté par: Xartrick le 11 Juin 2011, 21:55:04
Toujours la même erreur, tu utilise une fonction de récupération à la place d'une fonction d'attribution !

Code: (Pawn) [Sélectionner]
if(strcmp(cmd, "/heal", true) == 0)
{
new playa = 0;

tmp = strtok(cmdtext, idx);

if(strlen(tmp))
{
playa = strval(tmp);

if(IsPlayerConnected(playa)) SetPlayerHealth(playa, 100);
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE : /heal [ID]");
}

return 1;
}
Titre: Re : Problème /heal
Posté par: .:: Miguel .:: le 11 Juin 2011, 21:56:01
Merci!
Titre: Re : Problème /heal
Posté par: vitry_selkato le 16 Juin 2011, 01:45:02
Lol , Co toi sur Pub , Et n'hésite pas a demander .
Titre: Re : Problème /heal
Posté par: cristab le 16 Juin 2011, 08:17:16
evite de rapatrier des membres de la sorte sa ressemble a de la pub vitry_selkato