Server crashing...
#1

pawn Код:
command(setzombie, playerid, params[])
{
    new pID;
    if( PlayerInfo[playerid][Admin] >= 4)
    {
        if(sscanf(params, "ud", pID)) return SendClientMessage(playerid, COLOUR_WHITE, "Usage: /setzombie [Player/Name]");
        gTeam[pID] = TEAM_ZOMBIE;
        PlayerInfo[pID][Zombie] = 1;
        SetPlayerPos(pID, ZOMBIESPAWN);
        SetPlayerColor(pID, COLOUR_YELLOW);
        SendClientMessage(pID, COLOUR_WHITE, "You have been changed into a zombie by an Admin" );
        SetPlayerSkin(pID, 162);
        GivePlayerWeapon(pID, 9, 0);
    }
    return 1;
}
pawn Код:
command(test, playerid, params[])
{
    if( GetPlayerTeam(playerid) == 2)
    {
        SendClientMessage(playerid, COLOUR_YELLOW, "YOU ARE A ZOMBIE!!!" );
    }
    else
    {
        SendClientMessage(playerid, COLOUR_WHITE, "YOU ARE NOT A ZOMBIE!!!" );
    }
    return 1;
}
Thats what the command is, however when its used it crashes my server. Can anyone see whats wrong?
Reply
#2

Try this format:
pawn Код:
if(sscanf(params, "r", pID))
Read the sscanf topic again.

Код:
Specifier(s)			Name				Example values
	i, d			Integer				1, 42, -10
	c			Character			a, o, *
	l			Logical				true, false
	b			Binary				01001, 0b1100
	h, x			Hex				1A, 0x23
	o			Octal				045 12
	n			Number				42, 0b010, 0xAC, 045
	f			Float				0.7, -99.5
	g			IEEE Float			0.7, -99.5, INFINITY, -INFINITY, NAN, NAN_E
	u			User name/id (bots and players)	******, 0
	q			Bot name/id			ShopBot, 27
	r			Player name/id			******, 42
Reply
#3

Nope it is still crashing
Reply
#4

One question: What type of command system are you using?
Reply
#5

try dcmd or zcmd
Reply
#6

pawn Код:
if( sscanf( params, "u", pID ) )
"u" is for users.
pawn Код:
SetPlayerPos( pID, ZOMBIESPAWN );
Mind showing us ZOMBIESPAWN?

Also, you are giving player a weapon with no ammo... Like you didn't even give.
So change it to:
pawn Код:
GivePlayerWeapon( pID, 9, 1 ); // Gives player one chainsaw
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)