19.09.2012, 15:28
Hello guys, I tried to add hitman to my server with pHit and pHitamount but it's looks like it's crashing my whoel server everytime it's saving.
Here's a command to.
I get no errors I dont know why it's not working do you need add something in MySQL or something?
Код:
mysql_get_field("Hit", playerVariables[extraid][pHit]); mysql_get_field("Hitamount", playerVariables[extraid][pHitamount]);
Код:
format(saveQuery, sizeof(saveQuery), "%s, hit = '%d', hitamount = '%d'", saveQuery, playerVariables[playerid][pHit], playerVariables[playerid][pHitamount]);
Код:
dcmd_hit(playerid, params[]) { new amount; if(sscanf(params, "dd", ID, amount)) { SendClientMessage(playerid, COLOR_ERROR, "USAGE: /hit [ID] [amount]"); } else if(amount > 0) { if(IsPlayerConnected(ID)) { if(GetPlayerMoney(playerid) >= amount) { if(antispam[playerid] == 0) { hit[ID] = amount; hiter[ID] = playerid; new string[256]; format(string, sizeof(string), "You have placed a hit on %s (%i) for $%i", ReturnPlayerName(ID), ID, amount); SendClientMessage(playerid, COLOR_MSG, string); format(string, sizeof(string), "%s (%i) has placed a hit on %s (%i) for $%i", ReturnPlayerName(playerid), playerid, ReturnPlayerName(ID), ID, amount); SendClientMessageToAll(COLOR_MSG, string); playerVariables[ID][pHitamount] = amount; playerVariables[ID][pHit] = 1; } else { SendClientMessage(playerid, COLOR_ERROR, "Please wait before placing another hit!"); } } else { SendClientMessage(playerid, COLOR_ERROR, "You do not have enough money!"); } } else { SendClientMessage(playerid, COLOR_ERROR, "That player is not connected!"); } } else { SendClientMessage(playerid, COLOR_ERROR, "Minimum amount to hit a person with is $1!"); } return 1; }