/duty ~ "you need to type..
#1

Hey, since the dialog thing didnt go so well..
I would like a command:
/duty swat
It gives you 100 ammo, 100 hp, swat skin, M4 with unlimited bullets and teargas and a blue name colour.
THANKS.
Reply
#2

pawn Код:
COMMAND:duty(playerid, params[])
{
    if(sscanf(params, "s", params)) return SendClientMessage(playerid, -1, "Usage: /duty <swat>");
    if (!strcmp("swat", params, true))
    {
       SetPlayerHealth(playerid, 100);
       SetPlayerSkin(playerid, 285);
       GivePlayerWeapon(playerid, 31, 999999);
       GivePlayerWeapon(playerid, 17, 1);
       SetPlayerColor(playerid, 0x0000BBAA);
       SendClientMessage(playerid, -1, "You are now on SWAT Duty !");
       return 1;
    }
    return 1;
}
Reply
#3

Thanks.
Reply
#4

Weird, when I compiled, I got this:
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(92) : error 017: undefined symbol "duty"
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(94) : error 017: undefined symbol "params"
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(95) : error 017: undefined symbol "params"
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(10 : warning 225: unreachable code
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(10 : error 029: invalid expression, assumed zero
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(10 : error 004: function "OnPlayerEnterVehicle" is not implemented
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(113) : warning 225: unreachable code
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(113) : error 029: invalid expression, assumed zero
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(113) : error 004: function "OnPlayerExitVehicle" is not implemented
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(11 : warning 225: unreachable code
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(11 : error 029: invalid expression, assumed zero
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(11 : error 004: function "OnPlayerStateChange" is not implemented
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(123) : warning 225: unreachable code
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(123) : error 029: invalid expression, assumed zero
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(123) : error 004: function "OnPlayerEnterCheckpoint" is not implemented
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(12 : warning 225: unreachable code
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(12 : error 029: invalid expression, assumed zero
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(12 : error 004: function "OnPlayerLeaveCheckpoint" is not implemented
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(133) : warning 225: unreachable code
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(133) : error 029: invalid expression, assumed zero
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(133) : error 004: function "OnPlayerEnterRaceCheckpoint" is not implemented
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(13 : warning 225: unreachable code
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(13 : error 029: invalid expression, assumed zero
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(13 : error 004: function "OnPlayerLeaveRaceCheckpoint" is not implemented
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(143) : warning 225: unreachable code
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(143) : error 029: invalid expression, assumed zero
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(143) : error 004: function "OnRconCommand" is not implemented
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(14 : warning 225: unreachable code
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(14 : error 029: invalid expression, assumed zero
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(14 : error 004: function "OnPlayerRequestSpawn" is not implemented
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(153) : warning 225: unreachable code
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(153) : error 029: invalid expression, assumed zero
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(153) : error 004: function "OnObjectMoved" is not implemented
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(15 : warning 225: unreachable code
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(15 : error 029: invalid expression, assumed zero
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(15 : error 004: function "OnPlayerObjectMoved" is not implemented
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(163) : warning 225: unreachable code
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(163) : error 029: invalid expression, assumed zero

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


26 Errors.
Reply
#5

That has nothing to do with my code, make sure you have zcmd included at the top and all your strcmp cmds converted to zcmd or if you want you can convert that code to a strcmp cmd
Reply
#6

OH, I thought it was sscanf. Thanks
Reply
#7

Wow, again.

Quote:

C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(92) : error 029: invalid expression, assumed zero
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(92) : error 017: undefined symbol "cmd_duty"
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(92) : error 029: invalid expression, assumed zero
C:\Users\Mijn pc\Desktop\SWAT gamemode.pwn(92) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

I just did something wrong, but I dont know what.
Reply
#8

IT WORKS!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)