SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Romānă/Romanian

 
 
Thread Tools Display Modes
Old 17/02/2015, 04:05 PM   #1
Fusher
Little Clucker
 
Join Date: Jan 2015
Posts: 17
Reputation: 0
Default Problema else

Script-ul:
Code:
CMD:minigun(playerid, params[])
{
	GivePlayerWeapon(playerid, 38, 500);
	GivePlayerMoney(playerid, -100);
	{
		else
		{
			SendClientMessage(playerid, -1, "Tu nu ai atatia bani");
		}
	}
}
Eroare compilare:
Code:
(720) : error 029: invalid expression, assumed zero
Linia 720:
Code:
else
Problema este la acel "else"...care sa fie problema?
Fusher is offline  
Old 17/02/2015, 04:57 PM   #2
bogdyutzu
Big Clucker
 
Join Date: Nov 2011
Location: Romania, Pitesti
Posts: 121
Reputation: 5
Default Re: Problema else

Sti ce inseamna "else"?
bogdyutzu is offline  
Old 17/02/2015, 08:04 PM   #3
[NoV]LaZ
High-roller
 
Join Date: May 2008
Posts: 1,417
Reputation: 90
Default Re: Problema else

http://wiki.sa-mp.com/wiki/Control_Structures
__________________

Thank you for playing!

It is back online! 176.31.69.249:7799
[NoV]LaZ is offline  
Old 18/02/2015, 12:41 PM   #4
r0bi
Huge Clucker
 
Join Date: Sep 2013
Location: Romania
Posts: 228
Reputation: 1
Default Re: Problema else

"else " pui dupa o conditie adica dupa un "if", in cazul tau trebuie facut asa
PHP Code:
if(Daca am 100sau mai mult)
{
    
//primesc minigun
   //imi sunt retragi bani, adica 100$
}
else
{
   
//nu ai acesti bani

Acum pune in practica modelul, daca primesti mura in gura n-ai sa inveti
r0bi is offline  
Old 18/02/2015, 04:14 PM   #5
zork
Little Clucker
 
Join Date: Apr 2013
Posts: 24
Reputation: 0
Default Re: Problema else

Code:
CMD:minigun( playerid, params[] ) {

	if(GetPlayerMoney(playerid) >= 100) {

		GivePlayerWeapon(playerid, 38, 500);
		GivePlayerMoney(playerid, -100);
	} else {

		SendClientMessage(playerid, -1, "Nu ai atatia bani!");
	}
}
zork is offline  
Old 18/02/2015, 07:52 PM   #6
Lumineux
Huge Clucker
 
Lumineux's Avatar
 
Join Date: Apr 2013
Location: Romania, Prahova
Posts: 238
Reputation: 2
Default Re: Problema else

Quote:
Originally Posted by zork View Post
Code:
CMD:minigun( playerid, params[] ) {

	if(GetPlayerMoney(playerid) >= 100) {

		GivePlayerWeapon(playerid, 38, 500);
		GivePlayerMoney(playerid, -100);
	} else {

		SendClientMessage(playerid, -1, "Nu ai atatia bani!");
	}
}
Ideea era sa invete sa faca, nu sa primească mura-n gura.
Lumineux is offline  
Old 19/02/2015, 07:42 AM   #7
Fusher
Little Clucker
 
Join Date: Jan 2015
Posts: 17
Reputation: 0
Default Re: Problema else

Quote:
Originally Posted by zork View Post
Code:
CMD:minigun( playerid, params[] ) {

	if(GetPlayerMoney(playerid) >= 100) {

		GivePlayerWeapon(playerid, 38, 500);
		GivePlayerMoney(playerid, -100);
	} else {

		SendClientMessage(playerid, -1, "Nu ai atatia bani!");
	}
}
Rezolvat! Multumesc mult!
Fusher is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 12:11 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.