/stunt command.
#1

Hello, i have problem with /stunt command,
then player types: /stunt 99999999999999999999999999999999
server crashes, how to fix this?



Код:
dcmd_stunt(playerid, params[])
{
  //print("dcmd_stunt");
  if(PlayerInfo[playerid][pKova] == 1 || PlayerInfo[playerid][pDerby] == 1 || PlayerInfo[playerid][pSKY] == 1 || PlayerInfo[playerid][pFUN] == 1 || PlayerInfo[playerid][pCBUG] == 1 || RaceParticipant[playerid]>0 || dragParticipant[playerid]>0 || MaratonasParticipant[playerid]>0) return naudokplayer(playerid);
  //if(PlayerInfo[playerid][pLogged] == 0) return prisijunk(playerid);
	new req[32];
	if(sscanf(params, "s", req))
	{
  if(PlayerInfo[playerid][pSTUNT] >= 1) return STUNT_zonos(playerid);
  if(PlayerInfo[playerid][pSTUNT2] >= 1) return STUNT2_zonos(playerid);
  switch (PlayerInfo[playerid][pKalba]){
  case 0:GameTextForPlayer(playerid,"~r~Stunt:~n~~n~~w~/stunt 1 - 2",5000,3);
  case 1:GameTextForPlayer(playerid,"~r~Stuntai:~n~~n~~w~/stuntas 1 - 2",5000,3);}
	return true;
	}
//==============================================================================
  if(strcmp(req, "1", true) == 0)
	{
  if(PlayerInfo[playerid][pSTUNT] >= 1) return STUNT_zonos(playerid);
  if(PlayerInfo[playerid][pSTUNT2] >= 1) return STUNT2_zonos(playerid);
  prisijungtistunt(playerid);
	}
//==============================================================================
  if(strcmp(req, "2", true) == 0)
	{
  if(PlayerInfo[playerid][pSTUNT] >= 1) return STUNT_zonos(playerid);
  if(PlayerInfo[playerid][pSTUNT2] >= 1) return STUNT2_zonos(playerid);
  if(PlayerInfo[playerid][pSTUNTLaimeta] < 1){
  switch (PlayerInfo[playerid][pKalba]){
  case 0:SendClientMessage(playerid, COLOR_INFO,"INFO: You have to finish /stunt 1 first.");
  case 1:SendClientMessage(playerid, COLOR_INFO,"INFO: Tu turi бveikti /stunt 1 pirmiausia.");
	}
	return 1;
	}
  prisijungtistunt2(playerid);
	}
//==============================================================================
	else
	{
  if(PlayerInfo[playerid][pSTUNT] >= 1) return STUNT_zonos(playerid);
  if(PlayerInfo[playerid][pSTUNT2] >= 1) return STUNT2_zonos(playerid);
  switch (PlayerInfo[playerid][pKalba]){
  case 0:GameTextForPlayer(playerid,"~r~Stunt:~n~~n~~w~/stunt 1 - 2",5000,3);
  case 1:GameTextForPlayer(playerid,"~r~Stuntai:~n~~n~~w~/stuntas 1 - 2",5000,3);}
	}
 	return true;
}
Reply


Messages In This Thread
/stunt command. - by Reamis - 02.07.2009, 12:04
Re: /stunt command. - by refshal - 02.07.2009, 12:19
Re: /stunt command. - by Reamis - 02.07.2009, 12:20
Re: /stunt command. - by refshal - 02.07.2009, 12:23

Forum Jump:


Users browsing this thread: 2 Guest(s)