Problem with Server-Crash after Command
#1

Hello this is my first Post

I have a Problem with my /tazer command
i used ocmd but the server crashes after the command
I thought 1 return is Missing but don't find it
i dont recive errors
Sorry for my Bad Englich

This is my Code:
/* ---===[]Command[]===---- */
ocmd:tazer(playerid,params[])
{
new pID;
new pmessage[128],smessage[128];
new string;
new Float:CX,Float:CY,Float:CZ;
GetPlayerPos(playerid, CX, CY, CZ);
string = 0;
if(sscanf(params,"u",pID))return SendClientMessage(playerid,COLOR_RED,"/Tazer [Playerid]");
else
if(isPlayerInFrakt(playerid,4))
{
string = 1;
}
else
if(isPlayerInFrakt(playerid,1))
{
string = 1;
}
if(string == 0)return SendClientMessage(playerid,COLOR_RED,"Du bist kein Polizist");
if(GetPVarInt(pID,"Gefesselt")==1)return SendClientMessage(playerid,COLOR_RED,"Spieler ist bereits gefesselt");
if(GetPVarInt(pID,"Tazer")==1)return SendClientMessage(playerid,COLOR_RED,"Spieler ist bereits getazert");
if(!IsPlayerConnected(pID))return SendClientMessage(playerid,COLOR_RED,"Der Spieler ist nicht Online");
//if(!IsPlayerInRangeOfPoint(pID,10,CX,CY,CY))return SendClientMessage(playerid,COLOR_RED,"Der Spieler ist nicht in deiner Nдhe");
SendClientMessageToAll(COLOR_RED,"If's complete");//This is the last printed to player
SetPVarInt(pID,"Tazer",1);
SetTimerEx("Taz",10000,false,"i",playerid);
format(smessage,sizeof(smessage),"%s hat dich getazert",GetPlayerName(playerid));
format(pmessage,sizeof(pmessage),"Du hast %s getazert er wird sich nun mindestens 10 sekunden nicht mehr wдhren kцnnen",GetPlayerName(pID));//THIS IS THE WRONG LINE
SendClientMessage(playerid,COLOR_GREEN,pmessage);
return 1;
}
/* ---===[]Timer[]===--- */
forward Taz(pID);
public Taz(pID)
{
TogglePlayerControllable(pID,1);
SendClientMessage(pID,COLOR_YELLOW,"Du bist nun entfreezt");
return 1;
}

Thanks for all your Help
I found the wrong line if was the format
i think it was to long or something like this
Reply
#2

Try debugging your command. under each like type printf("debug 1"); make sure you change it e.g "debug 2","debug 3" etc, then check them one by one if one if them is missing means there's something wrong with that line.
Reply
#3

Thanks for your Help
I do it already
SendClientMessageToAll(COLOR_RED,"If's complete");
is the last printed to player
under this must be the something wrong
Reply
#4

I think the problem it is on "SetPVarInt(pID,"Tazer",1);" try to remove that line , and taze him again, if the server will crash again tell me I'll re build your command.
Reply
#5

Crashed again Pvar isn't the problem
--------------------------------------
I found the wrong line it was the format(pmessage ....
It was too long i Think
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)