Help me with a custom comand - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help me with a custom comand (
/showthread.php?tid=480957)
Help me with a custom comand -
moof2010 - 13.12.2013
Hi everybody, i tried to create a custom comand an since few minutes it crashed.
Yesterday work fine but today after i add a few lines was not respond, exactly my server say me that my comand don't exist.
There is my comand
Код:
dcmd_invita(playerid, params[])
{
new jucator[128];
if(sscanf(params,"s[128]", jucator)) return SendClientMessage(playerid, 0xFFFFFFF,"Comanda gresita. Corect: /invita [username] pentru a invita jucatori in factiune");
if(strcmp(factiune[playerid],"Medic",true) == 0)
{
if(rang[playerid] == 5)
{
new qm[300],rowss[128],fieldss[15][128];
format(qm, sizeof(qm), "SELECT `nume` FROM `users` WHERE nume = '%s'", jucator);
mysql_query(qm);
mysql_store_result();
mysql_fetch_row_format(rowss, "|");
explode(rowss, fieldss, "|");
format(jucator, 128, "%s", fieldss[0]);
new numrows2 = mysql_num_rows();
mysql_free_result(); //Eliberam baza de date
if(numrows2 == 1)
{
new Query[3000],mesajinvitatie[140],testjucator[128];
format(Query,3000,"INSERT INTO `medic` (`membru`, `mesaj`) VALUES ('%s', '%s')",jucator,mesajfactiune[playerid]);
mysql_query(Query);//Interogam baza de date
mysql_free_result(); //Eliberam baza de date
format(mesajinvitatie,sizeof(mesajinvitatie),"Ai invitat pe jucatorul %s in factiune.",jucator);
SendClientMessage(playerid, 0xFFFFFFFF,mesajinvitatie);
format(testjucator,sizeof(testjucator),"%s",GetPlayername(jucator,playerid,1));
if(strfind(testjucator, "Jucatorul", true) != -1)
{
SendClientMessage(GetPlayername(jucator,playerid,1), 0xFFFFFFFF, "Ai fost acceptat in factiunea Medic.");
SendClientMessage(GetPlayername(jucator,playerid,1), 0xFFFFFFFF, "Ca sa muncesti ca medic scrie /duty.");
}
}
else
{
SendClientMessage(playerid, 0xFFFFFFFF, "eroare inserare.");
}
}
else
{
SendClientMessage(playerid, 0xFFFFFFF , "Nu esti lider Medic.");
}
}
else
{
SendClientMessage(playerid, 0xFFFFFFF , "Acest serviciu nu exista.");
}
return 1;
}
Today i add the red lines and i don't want remove thats.
I consul my mysql debug and i found that the interaction between server and database was intrerupt at insert, no errors only don't call query.
The mysql quesries from this comand is working up to insert query, look
Код:
[18:49:30] CMySQLHandler::Query(SELECT `nume` FROM `users` WHERE nume = 'ashimap') - Successfully executed.
[18:49:30] >> mysql_store_result( Connection handle: 1 )
[18:49:30] CMySQLHandler::StoreResult() - Result was stored.
[18:49:30] >> mysql_fetch_row_format( Connection handle: 1 )
[18:49:30] CMySQLHandler::FetchRow() - Return: Ashimap //there is value of jucator after format
[18:49:30] >> mysql_num_rows( Connection handle: 1 )
[18:49:30] CMySQLHandler::NumRows() - Returned 1 row(s) // there is numrows2
[18:49:30] >> mysql_free_result( Connection handle: 1 )
[18:49:30] CMySQLHandler::FreeResult() - Result was successfully free'd.
I don't want to remove these lines because i don't want to require players to use case sensitive.
Thank you very much for your time spend with me.
Re: Help me with a custom comand -
moof2010 - 14.12.2013
someone can help me?