Jump to content
  • 0

Problema comanda [/requestevent].


Question

Posted (edited)

Problema intalnita (descriere):Comanda [/requestevent].
Ero(area / rile) / warning-(ul / urile):Cand tastez comanda in game nu functioneaza.
Liniile de cod / sursa / script-ul(obligatoriu):

Comanda : 

if(!strcmp(cmdtext, "/requestevent", true) || !strcmp(cmdtext, "/reqe", true)) // By AlyN
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te loghezi  mai intai.");
if(PlayerInfo[playerid][pWantedLevel] > 0) return SCM(playerid,COLOR_DS,"{37B9C8}You`re being chased by police, you can`t make an event.");
if(activeevent == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "{37B9C8}There's already an active event.");
if(requestingevent[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "{37B9C8}You're already requesting an event, cancel it first.");
new title[50], location[50], description[100], prize, time[50];
  if(sscanf( "p<|>s[50]s[50]s[50]s[100]d", title, location, time, description, prize)) return SendClientMessage(playerid, 0xFFFFFFFF, "{B8DBFF}Syntax: /requestevent <Title|Location|Time|Description|Prize>");
    if(strlen(title) < 0 || strlen(title) > 0)  return SendClientMessage(playerid, 0xFFFFFFFF, "{37B9C8}Invalid amount of characters in title.");
if(strlen(location) < 0 || strlen(location) > 50)   return SendClientMessage(playerid, 0xFFFFFFFF, "{37B9C8}Invalid amount of characters in location.");
if(strlen(time) < 1 || strlen(time) > 50) return SendClientMessage(playerid, 0xFFFFFFFF, "{37B9C8}Invalid amount of characters in time.");
if(strlen(description) < 1 || strlen(description) > 100)  return SendClientMessage(playerid, 0xFFFFFFFF, "{37B9C8}Invalid amount of characters in description.");
if(prize < 1 || prize > 5000000)  return SendClientMessage(playerid, 0xFFFFFFFF, "{37B9C8}Invalid prize amount.");
new dstring[1000],name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
requestingevent[playerid] = 1;
strmid(requestingtitle[playerid], title, 0, strlen(title));
strmid(requestinglocation[playerid], location, 0, strlen(location));
strmid(requestingdescription[playerid], description, 0, strlen(description));
requestingprize[playerid] = prize;
strmid(requestingtime[playerid], time, 0, strlen(time));
format(string, sizeof(dstring), "{FFFF00}Event %d has been requested, details are below.", playerid);
SendClientMessage(playerid, 0xFFFFFFFF, dstring);
format(string, sizeof(dstring), "{FFFF00}Event: Title: %s Prize: $%s Location: %s Time: %s",title,FormatNumber(prize), location, time);
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    format(string, sizeof(dstring), "{FFFF00}Event: Organizer: %s Description: %s",name,description);
    SendClientMessage(playerid, 0xFFFFFFFF, dstring);
SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Your event is pending approval from an admin, please wait.");
format(string, sizeof(dstring), "{FFFF00}Event %d has been requested, details are below.", playerid);
ABroadCast(0xFFFFFFFF,dstring,1);
format(string, sizeof(dstring), "{FFFF00}Event %d: Title: %s Prize: $%s Location: %s Time: %s",playerid,title,FormatNumber(prize), location, time);
    ABroadCast(0xFFFFFFFF,dstring,1);
format(string, sizeof(dstring), "{FFFF00}Event %d: Organizer: %s Description: %s",playerid,name,description);
ABroadCast(0xFFFFFFFF,string,1);
format(string, sizeof(dstring), "{FFFF00}Use [/acceptevent %d] to accept this event.", playerid);
ABroadCast(0xFFFFFFFF,dstring,1);
return 1;
}

 

Tastez [/requestevent] si apare textul : "Invalid amount of characters in title." , iar daca tastez [/requestevent test] imi spune ca serverul nu cunoaste comanda.

Imagini / Video (optional):

 

Cand tastez [/requestevent] :

 

txaCbd2.jpg

 

Cand tastez vreau sa pun titlu ex: [/requestevent Duele Deagle la GSLS] [ Titlu ] :

 

x1dDOBX.jpg

Ati incercat sa rezolvati singur?:Da, dar nu am reusit

Edited by MrAndrei

Recommended Posts

  • 0
Posted

Sterge comanda care ti-am dat-o cu ZCMD si pune la OnPlayerCommandText: (ce ti-am dat ultima data)

if(!strcmp(cmdtext, "/requestevent", true))
{
new title[50], location[50], description[100], prize, time[50];
new string[1000],name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
 if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
if(PlayerInfo[playerid][pWantedLevel] > 0) return SCM(playerid,COLOR_WHITE,"{FFB870}You`re being chased by police, you can`t make an event.");
if(activeevent == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFB870}There's already an active event.");
if(requestingevent[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFB870}You're already requesting an event, cancel it first.");
if(sscanf(params, "p</>s[50]s[50]s[50]s[100]d", title, location, time, description, prize)) return SendClientMessage(playerid, 0xFFFFFFFF, "{B8DBFF}Syntax: /requestevent <Title|Location|Time|Description|Prize>");
if(strlen(title) < 1 || strlen(title) > 50) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFB870}Invalid amount of characters in title.");
if(strlen(location) < 1 || strlen(location) > 50) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFB870}Invalid amount of characters in location.");
if(strlen(time) < 1 || strlen(time) > 50) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFB870}Invalid amount of characters in time.");
if(strlen(description) < 1 || strlen(description) > 100) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFB870}Invalid amount of characters in description.");
if(prize < 1 || prize > 5000000) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFB870}Invalid prize amount.");
requestingevent[playerid] = 1;
strmid(requestingtitle[playerid], title, 0, strlen(title));
strmid(requestinglocation[playerid], location, 0, strlen(location));
strmid(requestingdescription[playerid], description, 0, strlen(description));
requestingprize[playerid] = prize;
strmid(requestingtime[playerid], time, 0, strlen(time));
format(string, sizeof(string), "{FFFF00}Event %d has been requested, details are below.", playerid);
SendClientMessage(playerid, 0xFFFFFFFF, string);
format(string, sizeof(string), "{FFFF00}Event: Title: %s Prize: $%s Location: %s Time: %s",title,FormatNumber(prize), location, time);
SendClientMessage(playerid, 0xFFFFFFFF, string);
format(string, sizeof(string), "{FFFF00}Event: Organizer: %s Description: %s",name,description);
SendClientMessage(playerid, 0xFFFFFFFF, string);
SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Your event is pending approval from an admin, please wait.");
format(string, sizeof(string), "{FFFF00}Event %d has been requested, details are below.", playerid);
ABroadCast(0xFFFFFFFF,string,1);
format(string, sizeof(string), "{FFFF00}Event %d: Title: %s Prize: $%s Location: %s Time: %s",playerid,title,FormatNumber(prize), location, time);
ABroadCast(0xFFFFFFFF,string,1);
format(string, sizeof(string), "{FFFF00}Event %d: Organizer: %s Description: %s",playerid,name,description);
ABroadCast(0xFFFFFFFF,string,1);
format(string, sizeof(string), "{FFFF00}Use [/acceptevent %d] to accept this event.", playerid);
ABroadCast(0xFFFFFFFF,string,1);
return 1;
}

Ocupation: Youtube, Mined Bitcoin's, Scripting & Mapping SA:MP

  • 0
Posted

Dupa ce am stat pe wiki, si am invatat strcmp, am observat ca n-ai pus acel nr.

if(!strcmp(cmdtext, "/requestevent", true, 3) || !strcmp(cmdtext, "/reqe", true, 3)) // By AlyN
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te loghezi  mai intai.");
if(PlayerInfo[playerid][pWantedLevel] > 0) return SCM(playerid,COLOR_DS,"{37B9C8}You`re being chased by police, you can`t make an event.");
if(activeevent == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "{37B9C8}There's already an active event.");
if(requestingevent[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "{37B9C8}You're already requesting an event, cancel it first.");
new title[50], location[50], description[100], prize, time[50];
if(sscanf( "p<|>s[50]s[50]s[50]s[100]d", title, location, time, description, prize)) return SendClientMessage(playerid, 0xFFFFFFFF, "{B8DBFF}Syntax: /requestevent <Title|Location|Time|Description|Prize>");
if(strlen(title) < 0 || strlen(title) > 0)  return SendClientMessage(playerid, 0xFFFFFFFF, "{37B9C8}Invalid amount of characters in title.");
if(strlen(location) < 0 || strlen(location) > 50) return SendClientMessage(playerid, 0xFFFFFFFF, "{37B9C8}Invalid amount of characters in location.");
if(strlen(time) < 1 || strlen(time) > 50) return SendClientMessage(playerid, 0xFFFFFFFF, "{37B9C8}Invalid amount of characters in time.");
if(strlen(description) < 1 || strlen(description) > 100)  return SendClientMessage(playerid, 0xFFFFFFFF, "{37B9C8}Invalid amount of characters in description.");
if(prize < 1 || prize > 5000000)  return SendClientMessage(playerid, 0xFFFFFFFF, "{37B9C8}Invalid prize amount.");
new dstring[1000],name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
requestingevent[playerid] = 1;
strmid(requestingtitle[playerid], title, 0, strlen(title));
strmid(requestinglocation[playerid], location, 0, strlen(location));
strmid(requestingdescription[playerid], description, 0, strlen(description));
requestingprize[playerid] = prize;
strmid(requestingtime[playerid], time, 0, strlen(time));
format(string, sizeof(dstring), "{FFFF00}Event %d has been requested, details are below.", playerid);
SendClientMessage(playerid, 0xFFFFFFFF, dstring);
format(string, sizeof(dstring), "{FFFF00}Event: Title: %s Prize: $%s Location: %s Time: %s",title,FormatNumber(prize), location, time);
SendClientMessage(playerid, 0xFFFFFFFF, string);
format(string, sizeof(dstring), "{FFFF00}Event: Organizer: %s Description: %s",name,description);
SendClientMessage(playerid, 0xFFFFFFFF, dstring);
SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Your event is pending approval from an admin, please wait.");
format(string, sizeof(dstring), "{FFFF00}Event %d has been requested, details are below.", playerid);
ABroadCast(0xFFFFFFFF,dstring,1);
format(string, sizeof(dstring), "{FFFF00}Event %d: Title: %s Prize: $%s Location: %s Time: %s",playerid,title,FormatNumber(prize), location, time);
ABroadCast(0xFFFFFFFF,dstring,1);
format(string, sizeof(dstring), "{FFFF00}Event %d: Organizer: %s Description: %s",playerid,name,description);
ABroadCast(0xFFFFFFFF,string,1);
format(string, sizeof(dstring), "{FFFF00}Use [/acceptevent %d] to accept this event.", playerid);
ABroadCast(0xFFFFFFFF,dstring,1);
return 1;
}

 

Incearca asta.

  • 0
Posted

Am schimbat . This Command is .. in Unknown Command , am asa :

 

printf("[DEBUG]: #OnPlayerCommandText - %s | %s", sendername, cmd);
  return SendClientMessage(playerid, COLOR_DS, "{FFFF45}SERVER:Unknown command.");
  • 0
Posted

 

 

printf("[DEBUG]: #OnPlayerCommandText - %s | %s", sendername, cmd);

return SendClientMessage(playerid, COLOR_DS, "{FFFF45}SERVER:Unknown command.");

Chestia asta iti apare la toate comenzile?(Incearca sa tastezi alta comanda in sv).

  • 0
Posted

Nu..

Apare acel mesaj cand tastez unele comenzi care nu sunt in gamemode..

Dar la comanda [/requestevent] , imi apar direct datele fara sa pun detaliile, titlu, descriere etc etc

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.