When try to compile>Pawno crashed
#1

I checked for missing breckets, but i didnt found, so what is the reason ?
Reply
#2

Show all the code.
Reply
#3

I go a RP GM.I added one CMD
Код:
	new Float:RandomSpawn[][4] =
{

    {-96.9210, 1118.1365, 19.2258, 0.0000},
    { -102.9209, 1118.1432, 19.2258, 0.0000},
    { -99.9409, 1118.1344, 19.2258, 0.0000}
};
	new rand = random(sizeof(RandomSpawn));
CMD:fixmyvw(playerid, params[])
{

	if(IsPlayerInRangeOfPoint(playerid, 10, -99.8344, 1106.8241, 19.2258));
	GameTextForPlayer(playerid, "/fixmyvw to repair your car", 4000, 5);
	SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
	SetPlayerFacingAngle(playerid, RandomSpawn[rand][3]);
	if(IsPlayerInAnyVehicle(playerid) == 1)
    new car = GetPlayerVehicleID(playerid);
    SetVehiclePos(car, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
    SetVehicleZAngle(playerid, RandomSpawn[rand][3]);
    PutPlayerInVehicle(playerid, car);
	return 1;
}
and i tried to compile but pawno crashed, i delete this code and pawno again crashes, but before i add and delete this code pawno didnt crashed
Reply
#4

i really need help, so bump, i am sorry...
Reply
#5

What's that? You don't use block of code { }, you set the player position and then the vehicle position. A message about repairing your car is shown, that has nothing to do with "repair".

pawn Код:
new Float:RandomSpawn[3][4] =
{
    {-96.9210, 1118.1365, 19.2258, 0.0000},
    { -102.9209, 1118.1432, 19.2258, 0.0000},
    { -99.9409, 1118.1344, 19.2258, 0.0000}
};

CMD:fixmyvw(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 10, -99.8344, 1106.8241, 19.2258))
    {
        switch(GetPlayerState(playerid))
        {
            case PLAYER_STATE_ONFOOT:
            {
                new rand = random(sizeof(RandomSpawn));
                SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
                SetPlayerFacingAngle(playerid, RandomSpawn[rand][3]);
            }
            case PLAYER_STATE_DRIVER:
            {
                new rand = random(sizeof(RandomSpawn)), car = GetPlayerVehicleID(playerid);
                SetVehiclePos(car, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
                SetVehicleZAngle(car, RandomSpawn[rand][3]);
                PutPlayerInVehicle(playerid, car, 0);
            }
            case PLAYER_STATE_PASSENGER:
            {
                new rand = random(sizeof(RandomSpawn)), car = GetPlayerVehicleID(playerid), seat = GetPlayerVehicleSeat(playerid);
                SetVehiclePos(car, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
                SetVehicleZAngle(car, RandomSpawn[rand][3]);
                PutPlayerInVehicle(playerid, car, seat);
            }
        }
    }
    return 1;
}
Reply
#6

pawno again crash
Reply
#7

The problem is that either the script is missing bracket(s) or you add the code wrong (inside another callback etc..).
Reply
#8

Nope, i add the code at the end of my script, but before i added and deleted this code pawno didnt crashed....
Reply
#9

I remade my script in new file and works.Can sb tell me why the hell my timer dont work ?
pawn Код:
new Float:RandomSpawn[3][4] =
{
    {-96.9210, 1118.1365, 19.2258, 0.0000},
    { -102.9209, 1118.1432, 19.2258, 0.0000},
    { -99.9409, 1118.1344, 19.2258, 0.0000}
};

CMD:fixmyvw(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 10, -99.8344, 1106.8241, 19.2258))
    {
        GameTextForPlayer(playerid, "/fixmyvw to repair your car", 4000, 5);
        switch(GetPlayerState(playerid))
        {
            case PLAYER_STATE_ONFOOT:
            {
                SetTimerEx("EndRepairTime", 5000, false, "i", playerid);
                new rand = random(sizeof(RandomSpawn));
                SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
                SetPlayerFacingAngle(playerid, RandomSpawn[rand][3]);
            }
            case PLAYER_STATE_DRIVER:
            {
                SetTimerEx("EndRepairTime", 5000, false, "i", playerid);
                new rand = random(sizeof(RandomSpawn)), car = GetPlayerVehicleID(playerid);
                SetVehiclePos(car, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
                SetVehicleZAngle(car, RandomSpawn[rand][3]);
                PutPlayerInVehicle(playerid, car, 0);
            }
            case PLAYER_STATE_PASSENGER:
            {
                SetTimerEx("EndRepairTime", 5000, false, "i", playerid);
                new rand = random(sizeof(RandomSpawn)), car = GetPlayerVehicleID(playerid), seat = GetPlayerVehicleSeat(playerid);
                SetVehiclePos(car, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
                SetVehicleZAngle(car, RandomSpawn[rand][3]);
                PutPlayerInVehicle(playerid, car, seat);
            }
        }
    }
    return 1;
}
forward EndRepairTime(playerid);
public EndRepairTime(playerid)
{
    SetPlayerPos(playerid,-99.8344, 1106.8241, 19.2258);
    SendClientMessage(playerid, -1, "Your car was repaired.");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)