PDA

View Full Version : is this correct?


sampmark05
26/04/2012, 05:55 AM
CMD:goldrims
{
AddVehicleComponent(vehicleid, 1080);
)
return 1;
}

Im getting this error

C:\Documents and Settings\JUN.DELL\My Documents\Downloads\Games Installer\Next Revolution Roleplay\Next Revolution Roleplay\gamemodes\NR-RP.pwn(36668) : error 010: invalid function or declaration
C:\Documents and Settings\JUN.DELL\My Documents\Downloads\Games Installer\Next Revolution Roleplay\Next Revolution Roleplay\gamemodes\NR-RP.pwn(36671) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.

FalconX
26/04/2012, 05:59 AM
CMD:goldrims
{
AddVehicleComponent(vehicleid, 1080);
)
return 1;
}

Im getting this error

C:\Documents and Settings\JUN.DELL\My Documents\Downloads\Games Installer\Next Revolution Roleplay\Next Revolution Roleplay\gamemodes\NR-RP.pwn(36668) : error 010: invalid function or declaration
C:\Documents and Settings\JUN.DELL\My Documents\Downloads\Games Installer\Next Revolution Roleplay\Next Revolution Roleplay\gamemodes\NR-RP.pwn(36671) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.

Your code had few mistakes, but don't worry I fixed it.


CMD:goldrims(playerid, params[]) // (playerid, params[]) <-- this is very important
{
AddVehicleComponent(vehicleid, 1080);
return 1;
}


You will need zcmd include for this command.

-FalconX

RollTi
26/04/2012, 06:03 AM
Remove ')' to fix the error

sampmark05
26/04/2012, 06:03 AM
Thanks +rep

sampmark05
26/04/2012, 06:06 AM
i forgot to add this (playerid, params[])

FalconX
26/04/2012, 06:09 AM
i forgot to add this (playerid, params[])

I know :) Happy that your command is fixed now :)

sampmark05
26/04/2012, 06:15 AM
i have question again is this correct?

CMD:goldrims(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 4)
{
AddVehicleComponent(GetPlayerVehicleID(playerid), 1080);


return 1;
}
}

FalconX
26/04/2012, 06:16 AM
i have question again is this correct?

CMD:goldrims(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 4)
{
AddVehicleComponent(GetPlayerVehicleID(playerid), 1080);


return 1;
}
}

No, do it like this:-


CMD:goldrims(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 4)
{
AddVehicleComponent(GetPlayerVehicleID(playerid), 1080);
}
return 1;
}


-FalconX

Blunt P
26/04/2012, 06:17 AM
CMD:goldrims(playerid, params[])
{
#pragma unused params
if(PlayerInfo[playerid][pAdmin] >= 4)
{
AddVehicleComponent(GetPlayerVehicleID(playerid), 1080);
}
return 1;
}

sampmark05
26/04/2012, 06:22 AM
Thanks to all who helped me +rep and this is my CMD working now :)

http://i49.tinypic.com/n2d53s.png

Markô
26/04/2012, 06:29 AM
CMD:goldrims(playerid, params[])
{
#pragma unused params // Not needed
if(PlayerInfo[playerid][pAdmin] >= 4)
{
AddVehicleComponent(GetPlayerVehicleID(playerid), 1080);
}
return 1;
}

Zcmd won't return any warning if params remains unused, so #pragma unused params is never needed. Only dcmd does.

FalconX
26/04/2012, 06:30 AM
Zcmd won't return any warning if params remains unused, so #pragma unused params is never needed. Only dcmd does.

So true, I was going to post this.

And sampmark05, it's alright I don't help for reputation.

Markô
26/04/2012, 06:35 AM
So true, I was going to post this.

And sampmark05, it's alright I don't help for reputation.

That's why, in many ways zcmd is preferable over dcmd.