22.04.2014, 15:11
Thank you for your help but the problem still persists, here are the errors that it returns when I send "/t appel 223":
New command:
Quote:
[17:23:04] sscanf warning: No default value found. [17:23:04] sscanf warning: Unknown format specifier '[', skipping. [17:23:04] sscanf warning: Unknown format specifier '3', skipping. [17:23:04] sscanf warning: Unknown format specifier '2', skipping. [17:23:04] sscanf warning: Unknown format specifier ']', skipping. [17:23:04] sscanf warning: Unknown format specifier '(', skipping. [17:23:04] sscanf error: No specified parameters found. |
pawn Код:
CMD:t(playerid, params[])
{
new option[16], numero, texte[64], Float:x, Float:y, Float:z, telPID;
if(playerInfo[playerid][telephone] == 0) return SCM(playerid, TEL, "ARP: "BLANC1"Vous n'avez pas de telephone portable");
if(freezes[playerid] == true || mute[playerid] == true) return SCM(playerid, TEL, "ARP "BLANC1"Vous ne pouvez pas utilisez votre telephone pour le moment");
if(sscanf(params, "s[16]I(0)S[32](Aucun)", option, numero, texte)) { return SCM(playerid, TEL, "ARP: "BLANC1"/t <nom>"), SCM(playerid, TEL, "ARP: "BLANC1"Nom: "BLANC1"allumer, eteindre, appel, sms, rac(rocher), dec(rocher)"); }
if(!strcmp(option, "allumer", true))
{
if(playerInfo[playerid][telephoneStatus] == 1) return SCM(playerid, TEL, "ARP: "BLANC1"Votre telephone est dйjа allumй.");
playerInfo[playerid][telephoneStatus]=1;
SCM(playerid, TEL, "ARP: "BLANC1"Vous avez allumй votre telephone portable.");
GetPlayerPos(playerid, x, y, z);
PlayAudioStreamForPlayer(playerid, TELON, x, y, z, 5.0, 1);
}
else if(!strcmp(option, "eteindre", true))
{
if(playerInfo[playerid][telephoneStatus] == 0) return SCM(playerid, TEL, "ARP: "BLANC1"Votre telephone est dйjа йteint.");
playerInfo[playerid][telephoneStatus]=0;
SCM(playerid, TEL, "ARP: "BLANC1"Vous avez йteint votre telephone portable.");
GetPlayerPos(playerid, x, y, z);
PlayAudioStreamForPlayer(playerid, TELON, x, y, z, 5.0, 1);
}
else if(!strcmp(option, "appel", true))
{
if(numero == 0) return SCM(playerid, TEL, "ARP: "BLANC1"/t appel <numero>");
if(playerInfo[playerid][telephoneStatus] == 0) return SCM(playerid, TEL, "ARP: "BLANC1"Votre telephone est йteint.");
else if(playerInfo[playerid][telephoneCredits] == 0) return SCM(playerid, TEL, "ARP: "BLANC1"Vous n'avez plus de crйdits.");
else if(numero == playerInfo[playerid][telephone]) return SCM(playerid, TEL, "ARP: "BLANC1"Vous ne pouvez pas vous appelez.");
telPID = ReturnIdByNum(numero);
if(telPID == -1) return SCM(playerid, TEL, "ARP: "BLANC1"Numйro incorrect.");
if(playerInfo[telPID][telephoneStatus] == 0) return SCM(playerid, TEL, "ARP: "BLANC1"Le portable du correspondant est йteint.");
else if(inTel[telPID] >= 0) return SCM(playerid, TEL, "ARP: "BLANC1"Le correspondant est actuellement en ligne, rйessayer plus tard...");
else if(inTel[playerid] >= 0) return SCM(playerid, TEL, "ARP: "BLANC1"Vous кtes dйjа en communication.");
inTel[telPID]=playerid, inTel[playerid]=telPID, telAuthor[playerid]=1;
PlayAudioStreamForPlayer(playerid, SONNERIE, x, y, z, 5.0, 1);
PlayAudioStreamForPlayer(playerid, SONNERIE2, x, y, z, 5.0, 1);
format(commandes, sizeof(commandes), "ARP: "BLANC1"Composition du numero \"%d\", appel en cours...", numero);
SCM(playerid, TEL, commandes);
format(commandes, sizeof(commandes), "ARP: "BLANC1"(Sonnerie d'appel) %d", playerInfo[playerid][telephone]);
SCM(telPID, TEL, commandes);
telTimer[telPID]=SetTimerEx("EndCall", 30000, false, "iii", playerid, telPID, 3);
}
else if(!strcmp(option, "dec", true) || !strcmp(option, "decrocher", true))
{
if(playerInfo[playerid][telephoneStatus] == 0) return SCM(playerid, TEL, "ARP: "BLANC1"Votre telephone est йteint.");
if(inTel[playerid] == -1) return SCM(playerid, TEL, "ARP: "BLANC1"Votre telephone ne sonne pas.");
SCM(playerid, TEL, "ARP: "BLANC1"Vous avez dйcrochй.");
EndCall(playerid, inTel[playerid], ACCEPT);
}
else if(!strcmp(option, "rac", true) || !strcmp(option, "raccrocher", true))
{
if(playerInfo[playerid][telephoneStatus] == 0) return SCM(playerid, TEL, "ARP: "BLANC1"Votre telephone est йteint.");
if(inTel[playerid] == -1) return SCM(playerid, TEL, "ARP: "BLANC1"Vous n'кtes pas en communication.");
SCM(playerid, TEL, "ARP: "BLANC1"Vous avez racrochй.");
EndCall(playerid, inTel[playerid], REJECT);
}
else if(!strcmp(option, "sms", true))
{
if(numero == 0) return SCM(playerid, TEL, "ARP: "BLANC1"/t sms <numero> <texte>");
else if(!strcmp(texte, "Aucun", true)) return SCM(playerid, TEL, "ARP: "BLANC1"/t sms <numero> <texte>");
if(playerInfo[playerid][telephoneStatus] == 0) return SCM(playerid, TEL, "ARP: "BLANC1"Votre telephone est йteint.");
else if(inTel[playerid] != -1) return SCM(playerid, TEL, "ARP: "BLANC1"Vous кtes en communication.");
else if(playerInfo[playerid][telephoneCredits] == 0) return SCM(playerid, TEL, "ARP: "BLANC1"Vous n'avez plus de crйdits.");
else if(numero == playerInfo[playerid][telephone]) return SCM(playerid, TEL, "ARP: "BLANC1"Vous ne pouvez pas vous envoyez un sms.");
telPID = ReturnIdByNum(numero);
if(telPID == -1) return SCM(playerid, TEL, "ARP: "BLANC1"Numйro incorrect.");
if(playerInfo[telPID][telephoneStatus] == 0) return SCM(playerid, TEL, "ARP: "BLANC1"Le portable du correspondant est йteint.");
PlayAudioStreamForPlayer(telPID, TELON, x, y, z, 5.0, 1);
format(commandes, sizeof(commandes), "Message envoyй а %d: "BLANC1"\"%s\"", numero, texte);
SCM(playerid, TEL, commandes);
format(commandes, sizeof(commandes), "Message envoyй de %d: "BLANC1"\"%s\"", playerInfo[playerid][telephone], texte);
SCM(telPID, TEL, commandes);
playerInfo[playerid][telephoneCredits]--;
}
return 1;
}