SA-MP Forums Archive
Help!Crashing after command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help!Crashing after command (/showthread.php?tid=195824)



Help!Crashing after command - SkizzoTrick - 03.12.2010

Hello everyone,im so tired after lot of scripting,now i don't even realise what im doing

Could someone tell me what is wrong here?It just don't gets load and crashes after using
pawn Код:
if (strcmp(cmd, "/flights", true) == 0)
        {
            if (gPlayerLogged[playerid] != 0)
                {
                        for(new i=0; i<MAX_PLAYERS; i++)
                            {
                            new playerState = GetPlayerState(i);
                            new vehicleid = GetPlayerVehicleID(i);
                            if (playerState == PLAYER_STATE_DRIVER)
                                {
                                if(IsAPlane(vehicleid) || IsAHelli(vehicleid))
                                    {
                                        if(PlayerInfo[i][pInFlying] == 1)
                                            {
                                                new Float:x,Float:y,Float:z;
                                                GetPlayerPos(i,x,y,z);
                                                GetPlayerName(i, giveplayer, sizeof(giveplayer));
                                                new Info[128];
                                                if(PlayerInfo[i][pInFlying] == 1){Info = "In Flying";}
                                                if(PlayerInfo[i][pInFlying] == 0){Info = "On the ground";}

                                                new destination[128];
                                                if(PlayerInfo[playerid][pDestination] == 1){ destination = "Los Santos International Airport"; }
                                                else if(PlayerInfo[playerid][pDestination] == 2){ destination = "Las Venturas International Airport"; }
                                                else if(PlayerInfo[playerid][pDestination] == 3){ destination = "San Fierro International Airport"; }
                                                else if(PlayerInfo[playerid][pDestination] == 4){ destination = "Las Venturas Desert Airport"; }
                                                format(string, sizeof(string),"Name:%s Destination:%s Stats:%s",giveplayer, destination, Info);
                                                if (strlen(string) > 1) SendClientMessage(playerid, 0xF5DEB3AA, string);
                                                }
                                            }
                                        }
                                    }
                                }
                        else
                        {
                        SendClientMessage(playerid,COLOR_RED,"You need to logged in!");
                        }
                        return 1;
}

Now another problem,this don't gets load too:

This don't gives me any message,its purelly not working

pawn Код:
if (strcmp(cmd, "/stats", true) == 0)
    {
            if (gPlayerLogged[playerid] != 0)
                {
                ShowStats(playerid,playerid);
                }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   You are not Logged in!");
                return 1;
            }
            return 1;
    }
pawn Код:
public ShowStats(playerid,targetid)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(targetid,x,y,z);
    new string[128];
    new alevel = PlayerInfo[targetid][pAdminLevel];
    new Cash = PlayerInfo[targetid][pCash];
    new Score = PlayerInfo[targetid][pScore];
    new flights = PlayerInfo[targetid][pFlights];
    new Info[128];
    if(PlayerInfo[targetid][pInFlying] == 1){Info = "In Flying";}
    if(PlayerInfo[targetid][pInFlying] == 0){Info = "On the ground";}
   
    new pilotrank[21];
    if(PlayerInfo[targetid][pPilot] == 1){ pilotrank = "General Pilot"; }
    else if(PlayerInfo[targetid][pPilot] == 2){ pilotrank = "Co-Pilot"; }
    else if(PlayerInfo[targetid][pPilot] == 3){ pilotrank = "Stewart"; }
   
    new destination[128];
    if(PlayerInfo[targetid][pDestination] == 1){ destination = "Los Santos International Airport"; }
    else if(PlayerInfo[targetid][pDestination] == 2){ destination = "Las Venturas International Airport"; }
    else if(PlayerInfo[targetid][pDestination] == 3){ destination = "San Fierro International Airport"; }
    else if(PlayerInfo[targetid][pDestination] == 4){ destination = "Las Venturas Desert Airport"; }
   
    new atcrank[22];
    if(PlayerInfo[targetid][pAtcPlayer] == 1){ destination = "Lead Atc"; }
    else if(PlayerInfo[targetid][pAtcPlayer] == 2){ destination = "Atc Sergeant"; }

    SendClientMessage(playerid,COLOR_GREEN,"|____________________Your Stats : %s(%d)_____________________|");
    format(string, sizeof(string),"Account Stats: Admin Level:%d    Money:%d    Score:%d    Status:%s",alevel,Cash,Score,Info);
    SendClientMessage(playerid,COLOR_GREEN,string);
    format(string, sizeof(string),"Pilot Stats: Flights:%d  Current Destination:%s  Pilot Rank:%s",flights,destination,pilotrank);
    SendClientMessage(playerid,COLOR_GREEN,string);
    format(string, sizeof(string),"ATC Stats: ATC Rank:%s",atcrank);
    SendClientMessage(playerid,COLOR_GREEN,string);
    print("All the stats updated");
    return 1;
}
Im gonna put in the /credits the one who is helping me.Please


Re: Help!Crashing after command - Axuj - 03.12.2010

Maybe something wrong with this?

pawn Код:
gPlayerLogged[playerid] != 0



Re: Help!Crashing after command - SkizzoTrick - 03.12.2010

Nope,that checks if the player is logged in