Script goes crazy, does wierd things (I do not have explanation 4 this) -
erminpr0 - 24.11.2013
Ok, what the ..
PHP код:
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
??????????????????????????????????????????????????????????????????????
Many wierd things happens to my server (those things ARE not coded like that), I do NOT Load any filterscripts, I have updated ALL my includes and plugins, re-compiled script etc..
How can I explain, eg. i type /givegun playerid 46 (parachute)
It doesn't give me a parachute, but print like it was successfully given..
etc. I hope you have understood :/
Re: Script goes crazy, does wierd things (I do not have explanation 4 this) -
PrivatioBoni - 24.11.2013
You could start off by giving us your givegun CMD.
Re: Script goes crazy, does wierd things (I do not have explanation 4 this) -
erminpr0 - 24.11.2013
Ok, but it SOMETIMES work properly, and sometimes have glitches ( Other commands & stuff too )
but i will give you..
pawn Код:
YCMD:givegun(playerid, params[], help)
{
#pragma unused help
new string[128], player, gun, ammo;
if(PlayerInfo[playerid][pAdmin] < 3 && !IsPlayerAdmin(playerid))
return SCM(playerid, DARKRED, "[CA:RP]"gray" Admins only!");
else if(sscanf(params, "uii", player, gun, ammo))
{
SCM(playerid, ORANGE, "Usage: "white"/givegun [playerid/PartOfName] [gun id] [ammo]");
return 1;
}
else if(gun < 1 || gun == 19 || gun == 20 || gun == 21 || gun == 40 || gun == 44 || gun == 45 || gun > 46)
return SCM(playerid, GRAY, "*WRONG Gun ID!");
else if(gun > 34 && gun < 40 && !IsPlayerAdmin(playerid))
return SCM(playerid, GRAY, "** "blue"R.P.G"gray", "blue"Bazooka"gray", "blue"Flame thrower"gray", "blue"Minigun "gray"and "blue"Satchel Charge"gray" can give only RCON admins!");
else if(player== INVALID_PLAYER_ID)
return SCM(playerid, GRAY, "*Wrong ID");
else if(ammo < 1)
return SCM(playerid, GRAY, "Ammo can't go below 1!");
GivePlayerWeapon(igrac, gun, ammo);
format(string, sizeof(string), "[A] %s gave |%s| to player %s, ammo:%d!", RPname(playerid), weaponName(gun), RPname(player), ammo);
SendAdminMessage(1, RED, string);
SendHelperMessage(1, RED, string);
format(string, sizeof(string), " You have recieved %s (ammo: %d) from Admina %s", weaponName(gun),ammo,RPname(playerid));
SCM(player, GRAY, string);
return 1;
}
Re: Script goes crazy, does wierd things (I do not have explanation 4 this) - Emmet_ - 24.11.2013
Try updating the sscanf plugin and recompiling the includes maybe?
Re: Script goes crazy, does wierd things (I do not have explanation 4 this) -
theYiin - 24.11.2013
maybe other includes redefine GivePlayerWeapon function, or anticheat remove it. What includes are you useing?
Re: Script goes crazy, does wierd things (I do not have explanation 4 this) -
erminpr0 - 24.11.2013
Emmet: What did you mean with 're-compile includes', to update to newest version?
I'm not using anticheat, I wrote whole scripts from scratch..
im using
pawn Код:
#include <a_samp>
#include <sscanf2>
#include <streamer>
#include <foreach>
#include <YSI\y_ini>
#include <YSI\y_commands>
Re: Script goes crazy, does wierd things (I do not have explanation 4 this) -
Konstantinos - 24.11.2013
pawn Код:
GivePlayerWeapon(igrac, gun, ammo);
igrac? You should use
player because that's where it assings the ID to give the weapon to the player.
Код:
sscanf(params, "uii", player, gun, ammo)
Re: Script goes crazy, does wierd things (I do not have explanation 4 this) -
erminpr0 - 24.11.2013
I have translated whole code from Bosnian to English, imagine that "igrac" is "player", that's not problem...
i Said SOMETIMES it doesn't work properly, not always
Re: Script goes crazy, does wierd things (I do not have explanation 4 this) -
erminpr0 - 24.11.2013
Cmon guys there must be someone to help me with right solution, I am really f'ed up with this..