SA-MP Forums Archive
Hi, please solve this problem - 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: Hi, please solve this problem (/showthread.php?tid=186558)



Hi, please solve this problem - karakana7 - 29.10.2010

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
 	if(strcmp(cmdtext, "/hydra", true) == 0)
		{
            money = GetPlayerMoney(playerid);
                }
            if(money >= 500000)
            	{
					format(hydra, sizeof(hydra), "%s, tu nusipirkai masina Hydra uz %d-sveikiname!Smagios keliones!", GetPlayerName(playerid, vardas, sizeof(vardas)), SetPlayerMoney(playerid, -500000));
					new Float:x,Float:y,Float:z;
					GetPlayerPos(playerid, x, y, z);
					SetVehiclePos(playerid, x, y, z);
					SendClientMessage(playerid, 0xFFFFFFFF, hydra);
				}
		}
	else if( money < 500000) return SendClientMessage(playerid, 0xFFFFFFFF, "Tu neturi tiek pinigu, atsiknisk! :D");
	return 1;
	}
	return 0;
}
And I get these errors:
Код:
C:\Documents and Settings\Justas\Desktop\samp\gamemodes\Cowboy.pwn(66) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Justas\Desktop\samp\gamemodes\Cowboy.pwn(66) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Justas\Desktop\samp\gamemodes\Cowboy.pwn(66) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\Justas\Desktop\samp\gamemodes\Cowboy.pwn(66) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.



Re: Hi, please solve this problem - WillyP - 29.10.2010

line 66?


Re: Hi, please solve this problem - karakana7 - 29.10.2010

Now I get these errors:
Код:
C:\Documents and Settings\Justas\Desktop\samp\gamemodes\Cowboy.pwn(68) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\Justas\Desktop\samp\gamemodes\Cowboy.pwn(68) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\Justas\Desktop\samp\gamemodes\Cowboy.pwn(80) : warning 203: symbol is never used: "vardas"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
And these lines is:
Код:
	format(hydra, sizeof(hydra), "%s, tu nusipirkai masina Hydra uz %d-sveikiname!Smagios keliones!", GetPlayerName(playerid, vardas, sizeof(vardas)), SetPlayerMoney(playerid, -500000));
And all code:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
 	if(strcmp(cmdtext, "/hydra", true) == 0)
	{
 	money = GetPlayerMoney(playerid);
  	if(money >= 500000)
  	{
	format(hydra, sizeof(hydra), "%s, tu nusipirkai masina Hydra uz %d-sveikiname!Smagios keliones!", GetPlayerName(playerid, vardas, sizeof(vardas)), SetPlayerMoney(playerid, -500000));
	new Float:x,Float:y,Float:z;
	GetPlayerPos(playerid, x, y, z);
	SetVehiclePos(playerid, x, y, z);
	SendClientMessage(playerid, 0xFFFFFFFF, hydra);
	}
	else if( money < 500000) return SendClientMessage(playerid, 0xFFFFFFFF, "Tu neturi tiek pinigu, atsiknisk! :D");
	return 1;
	}
	return 0;
}



Re: Hi, please solve this problem - WillyP - 29.10.2010

if( money < 500000) return SendClientMessage(playerid, 0xFFFFFFFF, "Tu neturi tiek pinigu, atsiknisk! ");


Re: Hi, please solve this problem - DeathOnaStick - 29.10.2010

Quote:
Originally Posted by [FU]Victious
Посмотреть сообщение
if( money < 500000) return SendClientMessage(playerid, 0xFFFFFFFF, "Tu neturi tiek pinigu, atsiknisk! ");
Won't change a thing, it's all correct with this line.


Re: Hi, please solve this problem - WillyP - 29.10.2010

Quote:
Originally Posted by DeathOnaStick
Посмотреть сообщение
Won't change a thing, it's all correct with this line.
yeah.. i know...

but since that was the line that was giving errors, i changed.............


Re: Hi, please solve this problem - karakana7 - 29.10.2010

Ok now I fixed many errors and get this one:
Код:
C:\Documents and Settings\Justas\Desktop\samp\gamemodes\Cowboy.pwn(68) : error 017: undefined symbol "SetPlayerMoney"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
How to fix it?
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
 	if(strcmp(cmdtext, "/hydra", true) == 0)
	{
 	money = GetPlayerMoney(playerid);
  	if(money >= 500000)
  	{
	format(hydra, sizeof(hydra), "%s, tu nusipirkai masina Hydra uz %d-sveikiname!Smagios keliones!", GetPlayerName(playerid, vardas, sizeof(vardas)), SetPlayerMoney(playerid, -500000));
	new Float:x,Float:y,Float:z;
	GetPlayerPos(playerid, x, y, z);
	SetVehiclePos(playerid, x, y, z);
	SendClientMessage(playerid, 0xFFFFFFFF, hydra);
	return 1;
	}
    if( money < 500000) return SendClientMessage(playerid, 0xFFFFFFFF, "Tu neturi tiek pinigu, atsiknisk! :D");
	return 1;
	}
	return 0;
}



Re: Hi, please solve this problem - DeathOnaStick - 29.10.2010

Quote:
Originally Posted by karakana7
Посмотреть сообщение
Ok now I fixed many errors and get this one:
Код:
C:\Documents and Settings\Justas\Desktop\samp\gamemodes\Cowboy.pwn(68) : error 017: undefined symbol "SetPlayerMoney"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
How to fix it?
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
 	if(strcmp(cmdtext, "/hydra", true) == 0)
	{
 	money = GetPlayerMoney(playerid);
  	if(money >= 500000)
  	{
	format(hydra, sizeof(hydra), "%s, tu nusipirkai masina Hydra uz %d-sveikiname!Smagios keliones!", GetPlayerName(playerid, vardas, sizeof(vardas)), SetPlayerMoney(playerid, -500000));
	new Float:x,Float:y,Float:z;
	GetPlayerPos(playerid, x, y, z);
	SetVehiclePos(playerid, x, y, z);
	SendClientMessage(playerid, 0xFFFFFFFF, hydra);
	return 1;
	}
    if( money < 500000) return SendClientMessage(playerid, 0xFFFFFFFF, "Tu neturi tiek pinigu, atsiknisk! :D");
	return 1;
	}
	return 0;
}
Replace it with GivePlayerMoney, if it would do the same.


Re: Hi, please solve this problem - karakana7 - 29.10.2010

Quote:
Originally Posted by DeathOnaStick
Посмотреть сообщение
Replace it with GivePlayerMoney, if it would do the same.
Thank you man, you helped me alot, but why this function SetPlayerMoney isn't woking correctly?


Re: Hi, please solve this problem - WillyP - 29.10.2010

use a stock

such as

pawn Код:
stock SetPlayerMoney(playerid)
{
GivePlayerMoney(playerid)
}
i did it in here, not in pawno