SA-MP Forums Archive
Why is that didn't work? - 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)
+--- Thread: Why is that didn't work? (/showthread.php?tid=354912)



Why is that didn't work? [solved] - Gangster-rocks - 28.06.2012

Solved.


Re: Why is that didn't work? - JaKe Elite - 28.06.2012

you never used them.

the loose indentation is made because your script indenting is bad.
Press Tab to indent a script code
Shift + Tab to unindent a script code


Re: Why is that didn't work? - kepa333 - 28.06.2012

try this

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/miniguns", cmdtext, true, 5) == 0)
    {
        new minigun1;
        new minigun2;
        minigun1 = CreateObject(362, 0.78, 1.46, 0.40,   2.40, 27.12, 87.01);
        minigun2 = CreateObject(362, -0.52, 1.29, 0.50,   2.40, 27.12, 87.01);
        AttachObjectToVehicle(GetPVarInt(playerid, "minigun1"), GetPlayerVehicleID(playerid), 0.78, 1.46, 0.40,   2.40, 27.12, 87.01);
        AttachObjectToVehicle(GetPVarInt(playerid, "minigun2"), GetPlayerVehicleID(playerid), -0.52, 1.29, 0.50,   2.40, 27.12, 87.01);
        return 1;
    }
    if (strcmp("/rpgs", cmdtext, true, 10) == 0)
    {
         new RPG1;
         new RPG2;
         RPG1 = CreateObject(359, 0.53, -0.33, 0.72,   0.00, 0.00, 86.16);
         RPG2 = CreateObject(359, -0.58, -0.18, 0.72,   0.00, 0.00, 86.16);
         AttachObjectToVehicle(GetPVarInt(playerid, "RPG1"), GetPlayerVehicleID(playerid), 0.53, -0.33, 0.72,   0.00, 0.00, 86.16);
         AttachObjectToVehicle(GetPVarInt(playerid, "RPG2"), GetPlayerVehicleID(playerid), -0.58, -0.18, 0.72,   0.00, 0.00, 86.16);
        return 1;
    }
im not sure but i think it will work


Re: Why is that didn't work? - Gangster-rocks - 28.06.2012

Код:
C:\DOCUME~1\admin\Desktop\NEF7FE~1\FILTER~1\cartuner.pwn(151) : warning 204: symbol is assigned a value that is never used: "minigun2"
C:\DOCUME~1\admin\Desktop\NEF7FE~1\FILTER~1\cartuner.pwn(150) : warning 204: symbol is assigned a value that is never used: "minigun1"
C:\DOCUME~1\admin\Desktop\NEF7FE~1\FILTER~1\cartuner.pwn(164) : warning 217: loose indentation
C:\DOCUME~1\admin\Desktop\NEF7FE~1\FILTER~1\cartuner.pwn(161) : warning 204: symbol is assigned a value that is never used: "RPG2"
C:\DOCUME~1\admin\Desktop\NEF7FE~1\FILTER~1\cartuner.pwn(160) : warning 204: symbol is assigned a value that is never used: "RPG1"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Warnings.
With your code Kepa


Re: Why is that didn't work? - JaTochNietDan - 28.06.2012

Quote:
Originally Posted by Gangster-rocks
Посмотреть сообщение
Код:
C:\DOCUME~1\admin\Desktop\NEF7FE~1\FILTER~1\cartuner.pwn(151) : warning 204: symbol is assigned a value that is never used: "minigun2"
C:\DOCUME~1\admin\Desktop\NEF7FE~1\FILTER~1\cartuner.pwn(150) : warning 204: symbol is assigned a value that is never used: "minigun1"
C:\DOCUME~1\admin\Desktop\NEF7FE~1\FILTER~1\cartuner.pwn(164) : warning 217: loose indentation
C:\DOCUME~1\admin\Desktop\NEF7FE~1\FILTER~1\cartuner.pwn(161) : warning 204: symbol is assigned a value that is never used: "RPG2"
C:\DOCUME~1\admin\Desktop\NEF7FE~1\FILTER~1\cartuner.pwn(160) : warning 204: symbol is assigned a value that is never used: "RPG1"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Warnings.
With your code Kepa
Simply remove the unused variables then? If they are never used, there's no need for them to exist, so remove the declaration of those variables!


Re: Why is that didn't work? - Gangster-rocks - 28.06.2012

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
Simply remove the unused variables then? If they are never used, there's no need for them to exist, so remove the declaration of those variables!
When i do this its give me errors


Re: Why is that didn't work? - Dodo9655 - 28.06.2012

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/miniguns", cmdtext, true, 5) == 0)
    {
        new minigun1;
        new minigun2;
        minigun1 = CreateObject(362, 0.78, 1.46, 0.40,   2.40, 27.12, 87.01);
        minigun2 = CreateObject(362, -0.52, 1.29, 0.50,   2.40, 27.12, 87.01);
        AttachObjectToVehicle(GetPVarInt(playerid, "minigun1"), GetPlayerVehicleID(playerid), 0.78, 1.46, 0.40,   2.40, 27.12, 87.01);
        AttachObjectToVehicle(GetPVarInt(playerid, "minigun2"), GetPlayerVehicleID(playerid), -0.52, 1.29, 0.50,   2.40, 27.12, 87.01);
        return 1;
    }
    if (strcmp("/rpgs", cmdtext, true, 10) == 0)
    {
         new RPG1;
         new RPG2;
         RPG1 = CreateObject(359, 0.53, -0.33, 0.72,   0.00, 0.00, 86.16);
         RPG2 = CreateObject(359, -0.58, -0.18, 0.72,   0.00, 0.00, 86.16);
         AttachObjectToVehicle(GetPVarInt(playerid, "RPG1"), GetPlayerVehicleID(playerid), 0.53, -0.33, 0.72,   0.00, 0.00, 86.16);
         AttachObjectToVehicle(GetPVarInt(playerid, "RPG2"), GetPlayerVehicleID(playerid), -0.58, -0.18, 0.72,   0.00, 0.00, 86.16);
        return 1;
    }
}
You were missing a bracket


Re: Why is that didn't work? - Gangster-rocks - 28.06.2012

Not working -_- THIS SUCK


Re: Why is that didn't work? - JaKe Elite - 28.06.2012

Instead of saying suck try to figure out yourself.
We are trying our best to solve your problem but what you call us suck
Get a life dude.