SA-MP Forums Archive
[SOLVED] - 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: [SOLVED] (/showthread.php?tid=130808)



[SOLVED] - MaykoX - 28.02.2010

Код:
public OnPlayerSpawn(playerid)
{
  S_OnPlayerSpawn(playerid);
  SetPlayerArmour(playerid,100);
  SetPlayerTeamColor(playerid);
	spawn(playerid);
	SendClientMessage(playerid,COLOR_RED,"You have entered the EXTREME WAR !");
	return 1;
}
spawn(playerid, classid)
{
  if (classid == 0)
  {
  GivePlayerWeapon(playerid,31,500);
  GivePlayerWeapon(playerid,32,500);
  GivePlayerWeapon(playerid,22,500);
  }
	else if (classid == 1)
  {
  GivePlayerWeapon(playerid,32,500);
  GivePlayerWeapon(playerid,22,500);
  }
  else if (classid == 2)
  {
	GivePlayerWeapon(playerid,35,50);
  GivePlayerWeapon(playerid,22,500);
  GivePlayerWeapon(playerid,32,500);
  GivePlayerWeapon(playerid,4,500);
  }
  else if (classid == 3)
  {
  GivePlayerWeapon(playerid,32,500);
  GivePlayerWeapon(playerid,34,250);
  GivePlayerWeapon(playerid,4,50);
	}
  else if (classid == 4)
  {
  GivePlayerWeapon(playerid,31,500);
  GivePlayerWeapon(playerid,32,500);
  GivePlayerWeapon(playerid,22,500);
  }
  else if (classid == 5)
  {
  GivePlayerWeapon(playerid,32,500);
  GivePlayerWeapon(playerid,22,500);
  }
  else if (classid == 6)
  {
	GivePlayerWeapon(playerid,35,50);
  GivePlayerWeapon(playerid,22,500);
  GivePlayerWeapon(playerid,32,500);
  GivePlayerWeapon(playerid,4,500);
  }
  else if (classid == 7)
  {
  GivePlayerWeapon(playerid,32,500);
  GivePlayerWeapon(playerid,34,250);
  GivePlayerWeapon(playerid,4,50);
  }
	return 1;
}
It gives weapons from classid 0 to everyone.


Re: What am i doing wrong ? - Correlli - 28.02.2010

I see you have two params at function spawn (playerid & classid), but you're only using the playerid param:
Quote:
Originally Posted by MaykoX™
Код:
spawn(playerid);



Re: What am i doing wrong ? - notime - 28.02.2010

aahh i just wanted to post the same >.<


Re: What am i doing wrong ? - MaykoX - 28.02.2010

Quote:
Originally Posted by Don Correlli
I see you have two params at function spawn (playerid & classid), but you're only using the playerid param:
Quote:
Originally Posted by MaykoX™
Код:
spawn(playerid);
I tried to make spawn(playerid,classid) but than i get some wierd errors. ( I changed onplayerspawn... [added ,classid] than i get error that something is diffrent than prototype. Can someone tell me how to do it ? XD


Re: What am i doing wrong ? - notime - 28.02.2010

then change this:
Код:
forward spawn(playerid);
to
Код:
forward spawn(playerid, classid);



Re: What am i doing wrong ? - [03]Garsino - 28.02.2010

spawn(classid);


Re: What am i doing wrong ? - MaykoX - 28.02.2010

Quote:
Originally Posted by Notime
then change this:
Код:
forward spawn(playerid);
to
Код:
forward spawn(playerid, classid);
Thanks.

EDIT: It works thanks.


Re: What am i doing wrong ? - notime - 28.02.2010

your welcome