SA-MP Forums Archive
I need some help here - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I need some help here (/showthread.php?tid=253863)



I need some help here - Kobatz - 08.05.2011

Hello peoples i've made /takegunm4 command for Army .. but few warning appear and CMD doesn't work how it should.
This is the CMD:
Код:
if (strcmp("/takem4", cmdtext, true, 10) == 0)
	{
		if(IsPlayerInRangeOfPoint(2790.4155,-2486.0696,13.6471))
		GivePlayerWeapon(playerid,31,400); // 31 is weapons (m4) ID and 200 is ammount of bullets
		else SendClientMessage(playerid, COLOR_RED, "You have to be in Army Base Garage Three to take m4");
        new playername[24];
        new str[128]; // String
        GetPlayerName(playerid, playername, sizeof(playername)); // Gets the player name for this action.
         format(str, sizeof(str), "%s has opened a box and takes out m4 with some ammo", playername); // What it's going to look like.
         SendClientMessageToAll(COLOR_RED, str); // Color to send the message to everyone in.
		 return 1;
	}
Код:
Warnings:

C:\Documents and Settings\NO\My Documents\Downloads\New Folder\gamemodes\Nrd.pwn(664) : warning 213: tag mismatch
C:\Documents and Settings\NO\My Documents\Downloads\New Folder\gamemodes\Nrd.pwn(664) : warning 202: number of arguments does not match definition
C:\Documents and Settings\NO\My Documents\Downloads\New Folder\gamemodes\Nrd.pwn(664) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Warnings.
I wanted to make /takegun cmd and /me takes out a m4 from the box with it.Takegun works but ME isn't.

Help?


Re: I need some help here - MadeMan - 08.05.2011

pawn Код:
if(IsPlayerInRangeOfPoint(playerid,5.0,2790.4155,-2486.0696,13.6471))



Re: I need some help here - Kobatz - 08.05.2011

Thanks,it worked.But now i got another problem,i tested CMD IG and it works but when i'm not in range of point it and do /takegunm4 it says You need to be in army base garage 3 to take m4 and down /me takes out m4 from the box. -_-'

Should i add one more is playerinrangeofpoint ?


Re: I need some help here - MadeMan - 08.05.2011

pawn Код:
if (strcmp("/takem4", cmdtext, true) == 0)
{
    if(IsPlayerInRangeOfPoint(playerid,5.0,2790.4155,-2486.0696,13.6471))
    {
        GivePlayerWeapon(playerid,31,400); // 31 is weapons (m4) ID and 200 is ammount of bullets
        new playername[24];
        new str[128]; // String
        GetPlayerName(playerid, playername, sizeof(playername)); // Gets the player name for this action.
        format(str, sizeof(str), "%s has opened a box and takes out m4 with some ammo", playername); // What it's going to look like.
        SendClientMessageToAll(COLOR_RED, str); // Color to send the message to everyone in.
    }
    else SendClientMessage(playerid, COLOR_RED, "You have to be in Army Base Garage Three to take m4");
    return 1;
}



Re: I need some help here - Kobatz - 08.05.2011

Thanks MadeMan you helped me a lot,Thanks so much again!