Slap Command Error
#1

When I type other playerId. It always slaps id 0. Sometimes it shows that 461 ID not connected to the server when I type a reason long than 5 letters or 7.. ? Can someone help me what's wrong in this script?


Ok guys, There's a error with every fucking command!

When I type a playerid who is not even connected to the server example : 4.
It shows "Playerid (66553) is not connected to the server"
I am using SFCRRPG Gamemode!!
Please help me! How to fix it!

Код:
CMD:slap(playerid,params[])
{
	if(AdminLevel[playerid] <= 2) return SendClientMessage(playerid,COLOR_ERROR,"You don't have access to this command");
	new ID, cmdreason, string[126], Float: PPos[3];
	if(sscanf(params,"us[100]",ID,cmdreason))
	{
	    SendClientMessage(playerid,COLOR_ERROR,"USAGE: /slap [playerid] [Reason]");
	    return 1;
	}
	if(IsSpawned[ID] != 1)
	{
		format(string,sizeof(string),"%s(%d) must be alive and spawned in order to slap him",PlayerName(ID),ID);
		SendClientMessage(playerid,COLOR_ERROR,string);
		return 1;
	}
	GetPlayerPos(ID, PPos[0], PPos[1], PPos[2]);
    SetPlayerPos(ID, PPos[0], PPos[1], PPos[2]+4);
    format(string,sizeof(string),"[ADMIN] %s(%d) has slapped %s(%d)",PlayerName(playerid),playerid,PlayerName(ID),ID);
    SendClientMessageToAll(COLOR_ADMIN,string);
    GameTextForPlayer(ID,"Slapped!", 3000, 1);
    return 1;
}
Reply
#2

Is it just for that command or others aswell?
Reply
#3

Quote:
Originally Posted by Lido
Посмотреть сообщение
Is it just for that command or others aswell?
Only for this command! Help plz
Reply
#4

try

if(sscanf(params,"uis[100]",ID,cmdreason))
Reply
#5

Quote:
Originally Posted by GoldZoroGrab
Посмотреть сообщение
try

if(sscanf(params,"uis[100]",ID,cmdreason))
It's working but the cmdreason is not showing in the message!
Reply
#6

Ok guys, There's a error with every fucking command!

When I type a playerid who is not even connected to the server example : 4.
It shows "Playerid (66553) is not connected to the server"
I am using SFCRRPG Gamemode!!
Please help me! How to fix it!
Reply
#7

for this command "slap" or all commands?
Reply
#8

Alright, you need to recompile your script using the latest version of SSCANF from the thread, and run using that plugin in your server.
Reply
#9

Quote:
Originally Posted by GoldZoroGrab
Посмотреть сообщение
for this command "slap" or all commands?
Now for every commands lol!
Reply
#10

Update all your plugins and includes then re-compile.
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)