[HELP] /plantbomb
#1

Problem FIXED

Thanks to [B2K]Hustler
Reply
#2

IsPlayerInAnyVehicle

Try This:
pawn Код:
if (strcmp("/plantbomb", cmdtext, true, 7) == 0)
   {
        if(bombh[playerid] == 1)
        {
                        if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_GRAD2,"You can't plant bombs from a vehicle!);
            new Float:X;
            new Float:Y;
            new Float:Z;
            new Float:A;
            ApplyAnimation(playerid, "
BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
            GetPlayerPos(playerid,X,Y,Z);
            GetPlayerFacingAngle(playerid, A);
            DestroyObject(bomb);
            X += (1 * floatsin(-A, degrees));
            Y += (1 * floatcos(-A, degrees));
            bomb = CreateObject(1654, X, Y, Z-0.8, 0, 0, 0);
            bombh[playerid]=0;
            bombp[playerid]=1;
        }
        else
        {
            SendClientMessage(playerid,COLOR_GRAD2,"
* You don't have a bomb to plant!");
            return 1;
        }
        return 1;
    }
Reply
#3

Quote:

C:\Dokumente und Einstellungen\Admin\Desktop\ls\gamemodes\ls.pwn(19 465) : warning 217: loose indentation
C:\Dokumente und Einstellungen\Admin\Desktop\ls\gamemodes\ls.pwn(19 469) : error 037: invalid string (possibly non-terminated string)
C:\Dokumente und Einstellungen\Admin\Desktop\ls\gamemodes\ls.pwn(19 469) : error 017: undefined symbol "You"
C:\Dokumente und Einstellungen\Admin\Desktop\ls\gamemodes\ls.pwn(19 469) : error 017: undefined symbol "can"
C:\Dokumente und Einstellungen\Admin\Desktop\ls\gamemodes\ls.pwn(19 469) : fatal error 107: too many error messages on one line

get a error
Reply
#4

Sorry, I forgot to put the apostrophe (") in the SendClientMEssage.

Try it now and it should work.
pawn Код:
if (strcmp("/plantbomb", cmdtext, true, 7) == 0)
  {
        if(bombh[playerid] == 1)
        {
                    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_GRAD2,"You can't plant bombs from a vehicle!");
                    new Float:X;
                    new Float:Y;
                    new Float:Z;
                    new Float:A;
                    ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
                    GetPlayerPos(playerid,X,Y,Z);
                    GetPlayerFacingAngle(playerid, A);
                    DestroyObject(bomb);
                    X += (1 * floatsin(-A, degrees));
                    Y += (1 * floatcos(-A, degrees));
                    bomb = CreateObject(1654, X, Y, Z-0.8, 0, 0, 0);
                    bombh[playerid]=0;
                    bombp[playerid]=1;
        }
        else
        {
            SendClientMessage(playerid,COLOR_GRAD2,"* You don't have a bomb to plant!");
            return 1;
        }
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)