CMD:createpickupjob(playerid, params[])
{
for(new r = 0; r < sizeof(InfoTextDrawJob); r++)
{
new idpickup, jobtype[64], nivrequis, vwtd=-1, INTTDPick;
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(sscanf(params,"isii", idpickup, jobtype, nivrequis, INTTDPick)) return SendClientMessage(playerid, -1,"[CMD]: /createpickupjob [IDPickup] [Job] [Niv] [PickupINT]");
CreateDynamicPickup(idpickup, 1, x, y, z, vwtd);
InfoTextDrawJob[r][LevelRQ] = nivrequis;
InfoTextDrawJob[r][InTextX] = x;
InfoTextDrawJob[r][InTextY] = y;
InfoTextDrawJob[r][InTextZ] = z;
InfoTextDrawJob[r][IDPickup] = idpickup;
InfoTextDrawJob[r][PickupVW] = vwtd;
InfoTextDrawJob[r][PickupINT] = INTTDPick;
new query[450];
mysql_format(g_iHandle, query, sizeof(query), "INSERT INTO `srv_td_job` (`InTextX` ,`InTextY`,`InTextZ`) VALUES (%f, %f, %f)", x, y, z);
mysql_tquery(g_iHandle, query);
break;
}
return 1;
}
Try using crashdetect, it would tell us if there's a crash. What just came in my mind is that loop crashing because it tries to access an index which is out of range.
|
Put some print to debug your command.
Question, why have you a sscanf line in your loop? |
CMD:createpickupjob(playerid, params[])
{
print("Starting command...")
new idpickup, jobtype[64], nivrequis, vwtd=-1, INTTDPick;
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(sscanf(params,"isii", idpickup, jobtype, nivrequis, INTTDPick)) return SendClientMessage(playerid, -1,"[CMD]: /createpickupjob [IDPickup] [Job] [Niv] [PickupINT]");
CreateDynamicPickup(idpickup, 1, x, y, z, vwtd);
printf("nivrequis: %i | x:%.2f | y:%.2f | z:%.2f | idpickup : %i | vwtd : %i | INTTDPick : %i", nivrequis, x, y, z, idpickup, vwtd, INTTDPick);
InfoTextDrawJob[r][LevelRQ] = nivrequis;
InfoTextDrawJob[r][InTextX] = x;
InfoTextDrawJob[r][InTextY] = y;
InfoTextDrawJob[r][InTextZ] = z;
InfoTextDrawJob[r][IDPickup] = idpickup;
InfoTextDrawJob[r][PickupVW] = vwtd;
InfoTextDrawJob[r][PickupINT] = INTTDPick;
new query[450];
print("Saving MYQSL params")
mysql_format(g_iHandle, query, sizeof(query), "INSERT INTO `srv_td_job` (`InTextX` ,`InTextY`,`InTextZ`) VALUES (%f, %f, %f)", x, y, z);
mysql_tquery(g_iHandle, query);
return 1;
}
CMD:createpickupjob(playerid, params[])
{
print("Starting command...");
new idpickup, jobtype[64], nivrequis, vwtd=-1, INTTDPick;
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(sscanf(params,"isii", idpickup, jobtype, nivrequis, INTTDPick)) return SendClientMessage(playerid, -1,"[CMD]: /createpickupjob [IDPickup] [Job] [Niv] [PickupINT]");
CreateDynamicPickup(idpickup, 1, x, y, z, vwtd);
printf("nivrequis: %i | x:%.2f | y:%.2f | z:%.2f | idpickup : %i | vwtd : %i | INTTDPick : %i", nivrequis, x, y, z, idpickup, vwtd, INTTDPick);
new query[450];
print("Saving MYQSL params");
mysql_format(g_iHandle, query, sizeof(query), "INSERT INTO `srv_td_job` (`InTextX` ,`InTextY`,`InTextZ`) VALUES (%f, %f, %f)", x, y, z);
mysql_tquery(g_iHandle, query);
return 1;
}
[23:42:51] Starting command... [23:42:57] Starting command... [23:42:57] nivrequis: 1 | x:1848.79 | y:-1814.41 | z:3.98 | idpickup : 1239 | vwtd : -1 | INTTDPick : 0 [23:42:57] Saving MYQSL params