[HELP] Please Help me! Thanks in advance
#1

Hi, i'm new to Pawno, i'm currently learning by Editing Kittens Russia VS America. Now it has more Features and Two new teams (France and Japan). Now, i'm trying to "hide" Sniper class from the map. Now, i don't know how to, but here's a part of the code..
Код:
if(classid == 13 || classid = 9 || classid = 5 || classid = 1)
	{
	    SetPlayerColor(playerid,PINK);
	    SendClientMessage(playerid,PINK,"Test");
	}
All of those Class Id's are Snipers, and i want them to disappear from the map. Since i don't know how to, i'm just making their colors PINK so that i'll know if it works. But no luck, can somebody help me please?

Thank you very much in advance,
Reply
#2

Put == everywhere, you only have it once, the rest is a single =
Reply
#3

Код:
if(classid == 13)
	{
	    SetPlayerColor(playerid,PINK);
	    SendClientMessage(playerid,PINK,"Test");
	}
if(classid = 9)
	{
	    SetPlayerColor(playerid,PINK);
	    SendClientMessage(playerid,PINK,"Test");
	}
if(classid = 5)
	{
	    SetPlayerColor(playerid,PINK);
	    SendClientMessage(playerid,PINK,"Test");
	}
if(classid = 1)
	{
	    SetPlayerColor(playerid,PINK);
	    SendClientMessage(playerid,PINK,"Test");
	}
Like this? If it is, Thank you. But how can i make it Disappear from the map?
I know ShowPlayerMarkers(0); but that makes it work for all. How can i make it work only for those Class ID's? Thanks
Reply
#4

PHP код:
if(classid == 13 || classid == || classid == || classid == 1)
    {
        
        
SetPlayerColor(playerid,0xFFFFFF00);
        
SendClientMessage(playerid,PINK,"Test");
    } 
Set last 2 numbers to 00 (Alpha transparent) and it will be good
Reply
#5

@Dimi Alright, that helps with the "Disappear from radar" thing, now.. It says

Код:
C:\Users\Gaming\Desktop\SAMP\gamemodes\WW3.pwn(1321) : error 017: undefined symbol "classid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Its placed on public OnPlayerSpawn(playerid) by the way.
So, how can i fix this?
- Thanks
Reply
#6

Yeah. I thought about that. I guess it would be good you could make OnPlayerSpawnEx(playerid,classid). Know how to do it?
Reply
#7

You mean This?
Код:
AddPlayerClassEx(0, 179, -328.12,1535.54,75.56,5.0618, 24, 28, 16, 4, 31, 150); // Assaut
 	AddPlayerClassEx(0, 179, -328.12,1535.54,75.56,5.0618, 23, 34, 29, 120, 34, 20); // Sniper
 	AddPlayerClassEx(0, 179, -328.12,1535.54,75.56,5.0618, 23, 34, 25, 20, 6, 1); // Engineer
 	AddPlayerClassEx(0, 179, -215.90,1446.17,76.50,5.0618, 23, 34, 29, 150, 17, 5); // Pilot
 	
 	AddPlayerClassEx(1, 287, 199.40,2071.82,22.90,31.7517, 24, 28, 16, 4, 31, 150); // Assaut
 	AddPlayerClassEx(1, 287, 199.40,2071.82,22.90,31.7517, 23, 34, 29, 120, 34, 20); // Sniper
 	AddPlayerClassEx(1, 287, 199.40,2071.82,22.90,31.7517, 23, 34, 25, 20, 6, 1); // Engineer
 	AddPlayerClassEx(1, 287, 29.96,1947.57,17.64,31.7517, 23, 34, 29, 150, 17, 5); // Pilot
 	
 	AddPlayerClassEx(2, 120, -661.07,370.81,16.39,5.0618, 24, 28, 16, 4, 31, 150); // Assaut
 	AddPlayerClassEx(2, 120, -558.44,442.93,16.39,5.0618, 23, 34, 29, 120, 34, 20); // Sniper
 	AddPlayerClassEx(2, 120, -661.07,370.81,16.39,5.0618, 23, 34, 25, 20, 6, 1); // Engineer
 	AddPlayerClassEx(2, 120, -558.44,442.93,16.39,5.0618, 23, 34, 29, 150, 17, 5); // Pilot

 	AddPlayerClassEx(3, 73, -227.63,2723.80,63.69,5.0618, 24, 28, 16, 4, 31, 150); // Assaut
 	AddPlayerClassEx(3, 73, -267.97,2608.16,63.28,5.0618, 23, 34, 29, 120, 34, 20); // Sniper
 	AddPlayerClassEx(3, 73, -227.63,2723.80,63.69,5.0618, 23, 34, 25, 20, 6, 1); // Engineer
 	AddPlayerClassEx(3, 73, -267.97,2608.16,63.28,5.0618, 23, 34, 29, 150, 17, 5); // Pilot
Yes i do, its placed below

Код:
public OnGameModeInit()
{
    // Briefcases (Buy)
	bcase = CreatePickup(1210, 2, 207.69, 1993.73, 17.64, 0); // USA Main Base ( AREA51 )
	bcase1 = CreatePickup(1210, 2, 64.33, 1942.54, 17.64, 0); // USA Secondary Base ( Area 51 - Helicopter Pads Station - )
	bcase2 = CreatePickup(1210, 2, -2.88, 1503.94, 14.04, 0); // (USA) Desert Outpost ( Near Area 51 )
	bcase3 = CreatePickup(1210, 2, -558.64, 433.82, 19.27, 0); // JAPAN Main Base (Aircraft Carrier)
	bcase4 = CreatePickup(1210, 2, -691.61, 957.86, 12.21, 0); // JAPAN Secondary Base ( Japanse Military Outpost )
	bcase5 = CreatePickup(1210, 2, -312.22, 1542.30, 75.56, 0); // RUSSIA Main Base (Satelite Base)
	bcase6 = CreatePickup(1210, 2, -310.56, 1303.52, 53.66, 0); // RUSSIA Military Outpost (Near Satelite Base - Tank Outpost - )
	bcase7 = CreatePickup(1210, 2, -227.52, 2710.40, 62.98, 0); // France Main Base
	// Don't use these lines if it's a filterscript
	SetGameModeText("World War 0.5 BETA");
EDIT: Oh, its OnPlayerSpawnEx, not AddPlayerClassEx, EPIC FAIL XD..
I'll try to find out in the Wiki, Thank you all for helping, i'll post anytime i have a Problem
Reply
#8

Nah. Give me 5 minutes and I'll script it for you.

EDIT: Here it is:

PHP код:
#include <a_samp>
new bool:IsSniper[MAX_PLAYERS];
public 
OnPlayerRequestClass(playerid,classid)
{
    if(
classid == 13 || classid == || classid == || classid == 1)
    {
        
IsSniper[playerid] = true;
    }
    else 
IsSniper[playerid] = false;
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    if(
IsSniper[playerid]) SetPlayerColor(playerid,0xFFFFFF00);
    return 
1;

Reply
#9

Its not on the wiki.
Thank you very much Dimi, i won't forget this
Reply
#10

No problem
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)