14.06.2014, 19:37
I don't really know what is the problem, but when i try to use this command samp-server.exe closes itself.
pawn Код:
CMD:invite(playerid, params[])
{
new id;
if(PI[playerid][Lider] == 0) return SCM(playerid, RED, " (greska) {FFFFFF}Nemate ovlastenje za koristenje ove komande !");
if(sscanf(params, "u", id)) return SCM(playerid, GREY, "Koristite: /invite [ID Igraca / Deo Imena]");
if(!IsPlayerConnected(id)) return SCM(playerid, TOMATO, " (greska) {FFFFFF}Taj igrac nije u igri !");
if(id == playerid) return SCM(playerid, TOMATO, " (greska) {FFFFFF}Ne mozete ovu komandu koristiti na sebi !");
if(PI[id][Clan] != 0 || PI[id][Lider] != 0) return SCM(playerid, TOMATO, " (greska) {FFFFFF}Taj igrac se vec nalazi u nekoj organizaciji !");
if(PI[playerid][Lider] == 1)
{
SCMF(playerid, YELLOW, " (info) {FFFFFF}Uspesno se ubacili igraca %s u Policijsku Jedinicu !");
SCMF(id, YELLOW, " (info) {FFFFFF}Lider %s vas je primio u Policiju Grada Los Santosa !");
PI[id][Clan] = 1;
PI[id][Rank] = 1;
SetPlayerSkin(id, PD_RANK1);
PI[id][Skin] = GetPlayerSkin(id);
SpawnPlayer(id);
return 1;
}
format(gQuery, sizeof(gQuery), "UPDATE `Igraci` SET `Clan` = '%d', `Skin` = '%d', `Rank` = '%d' WHERE `Ime` = '%s'", PI[id][Clan], PI[id][Skin], PI[id][Rank], ImeIgraca(id));
mysql_function_query(konekt, gQuery, true, "OnQueryFinish", "i", THREAD_OSTALO);
return 1;
}