Salut !
Désolé de reprendre le scripting un Dimanche mais bon =]
Alors, j' ai fais ce que vous m' avez dit, cette fois-ci on a l' air d' avoir avancé ^^
Voici la nouvelle commande (en gardant ta commande que tu m' avais donné Chneubeul) :
//Commande /vspawn voiture véhicule
if(strcmp(cmd, "/vspawn", true) == 0)
{
new tmp[128];
/* Extraction du premier paramètre (Cet appel à strtok reprend là où le
précédent s'était arrêté dans la variable cmdtext - cf post de Sim)*/
cmd = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_RED, "UTILISATION: /vspawn [nom/ID] [couleur1] [couleur2]");
return 1;
}
new modelid = ReturnModelByName(tmp);
if(modelid == 0)
{
SendClientMessage(playerid, COLOR_RED, "ID incorect ! Assurez vous d' avoir écrit un nom/ID Correct !");
return 1;
}
new color1 = 0;
tmp = strtok(cmdtext, idx);
if(strlen(tmp)) color1 = strval(tmp);
new color2 = 0;
tmp = strtok(cmdtext, idx);
if(strlen(tmp)) color2 = strval(tmp);
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
CreateVehicle(modelid,x,y,z,1,color1,color2,-1);
return 1;
}
Sauf que la fonction "strlen(tmp)" est toujours = a 0
Même si je rentre une commande ou pas
Que je rentre un ID correct ou incorrecte, le serveur m' affiche toujours la phrase "UTILISATION: /vspawn [nom/ID] [couleur1] [couleur2]"