SA-MP Forums Archive
How to make Case 2? - 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)
+--- Thread: How to make Case 2? (/showthread.php?tid=624379)



How to make Case 2? - Thanks - 15.12.2016

Hi everyone How to I can make Case 2? For onplayerentercheckpoint??

Can you help me?

Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(GetPlayerSkin(playerid) != 285) return SendClientMessage(playerid, -1, "{FF0000}Sorry This Place only For SWAT, you are not SWAT");
	GivePlayerWeapon(playerid, 24, 65);
	GivePlayerWeapon(playerid, 26, 150);
	GivePlayerWeapon(playerid, 31, 150);
	GivePlayerWeapon(playerid, 34, 50);
	SetPlayerArmour(playerid, 100);
	SetPlayerHealth(playerid, 100);
	SendClientMessage(playerid, -1, "{FF0000}You have been Refill Come Back After you Dead");
	case 2:
	if(GetPlayerSkin(playerid) != 287) return SendClientMessage(playerid, -1, "{FF0000}Sorry This Place only for Army Refiled, You are not Army");
	GivePlayerWeapon(playerid, 30, 100);
	GivePlayerWeapon(playerid, 27, 65);
	GivePlayerWeapon(playerid, 33, 35);
	GivePlayerWeapon(playerid, 16, 3);
	GivePlayerWeapon(playerid, 24, 65);
	return 1;
}



Re: How to make Case 2? - iLearner - 15.12.2016

You have to switch something to use case (So called switch case), what are you switching.


Re: How to make Case 2? - ISmokezU - 15.12.2016

I'll advice you to use Dynamic checkpoints

Create each checkpoint for specific classes. and you wont need cases,although you could uses cases Switch(checkpointid)
PHP код:
Example CreateDynamicCP(Float:xFloat:yFloat:zFloat:sizeworldid = -1interiorid = -1playerid = -1Float:distance 100.0);
public 
OnPlayerEnterDynamicCP(playeridcheckpointid){
     if(
checkpointid == Example) {
     if(
GetPlayerSkin(playerid) != 285) return SendClientMessage(playerid, -1"{FF0000}Sorry This Place only For SWAT, you are not SWAT");
     
GivePlayerWeapon(playerid2465);
     
GivePlayerWeapon(playerid26150);
     
GivePlayerWeapon(playerid31150);
     
GivePlayerWeapon(playerid3450);
     
SetPlayerArmour(playerid100);
     
SetPlayerHealth(playerid100);
     
SendClientMessage(playerid, -1"{FF0000}You have been Refill Come Back After you Dead");
     }
   }
 } 



Re: How to make Case 2? - Thanks - 15.12.2016

Quote:
Originally Posted by ISmokezU
Посмотреть сообщение
I'll advice you to use Dynamic checkpoints

Create each checkpoint for specific classes. and you wont need cases
PHP код:
Example CreateDynamicCP(Float:xFloat:yFloat:zFloat:sizeworldid = -1interiorid = -1playerid = -1Float:distance 100.0);
public 
OnPlayerEnterDynamicCP(playeridcheckpointid){
     if(
checkpointid == Example) {
     if(
GetPlayerSkin(playerid) != 285) return SendClientMessage(playerid, -1"{FF0000}Sorry This Place only For SWAT, you are not SWAT");
     
GivePlayerWeapon(playerid2465);
     
GivePlayerWeapon(playerid26150);
     
GivePlayerWeapon(playerid31150);
     
GivePlayerWeapon(playerid3450);
     
SetPlayerArmour(playerid100);
     
SetPlayerHealth(playerid100);
     
SendClientMessage(playerid, -1"{FF0000}You have been Refill Come Back After you Dead");
     }
   }
 } 
Hi Dear

This Code Should be OnPlayerSpawn?

Код:
Example*=*CreateDynamicCP(Float:x,*Float:y,*Float:z,*Float:size,*worldid*=*-1,*interiorid*=*-1,*playerid*=*-1,*Float:distance*=*100.0);



Re: How to make Case 2? - iLearner - 15.12.2016

OnGameModeInit()


Re: How to make Case 2? - Thanks - 15.12.2016

What's Wrong Here

Код:
Refil*=*CreateDynamicCP(1332.2339,1254.7034,10.8203,*3.0,-1,-1,-1,100.0);



Re: How to make Case 2? - Thanks - 15.12.2016

help


Re: How to make Case 2? - iLearner - 15.12.2016

Show us the errors?


Re: How to make Case 2? - RedRex - 15.12.2016

Codes for errors?


Re: How to make Case 2? - ISmokezU - 15.12.2016

Why you puttin **? lol.