HALP!!!!!!!!!!!!!!!!!!!!!!!!!!!!ROAR!!!!
#1

HALP im in a hurry to make a good RP scriptzors and im trying to add /contract from the godfather script this is what i put
Код:
	if(strcmp(cmd, "/contract", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	   	{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /contract [playerid/PartOfName] [amount]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /contract [playerid/PartOfName] [amount]");
				return 1;
			}
			moneys = strval(tmp);
			if(moneys < 1000 || moneys > 100000) { SendClientMessage(playerid, COLOR_GREY, "   Contract money must be atleast $1000, and not more then $100000!"); return 1; }
			if(PlayerInfo[playerid][pLevel] < 3)
			{
				SendClientMessage(playerid, COLOR_GRAD1, "You must be level 3 to place a Contract.");
				return 1;
			}
			if (IsPlayerConnected(giveplayerid))
			{
			    if(giveplayerid != INVALID_PLAYER_ID)
			    {
                    if(PlayerInfo[playerid][pFaction] != 255 && FactionInfo[PlayerInfo[playerid][pFaction]][fType] == 12)
				    {
				        SendClientMessage(playerid, COLOR_GREY, "   Cannot place Contracts on your own Agency!");
				        return 1;
				    }
                     if(PlayerInfo[playerid][pFaction] != 255 && FactionInfo[PlayerInfo[playerid][pFaction]][fType] == 12)
				    {
				        SendClientMessage(playerid, COLOR_GREY, "   Cannot place Contracts on your own Agency!");
				        return 1;
				    }
				    if(PlayerInfo[giveplayerid][pFaction] != 255 && FactionInfo[PlayerInfo[giveplayerid][pFaction]][fType] == 12)
				    {
				        SendClientMessage(playerid, COLOR_GREY, "   Can't contract a Hitman !");
				        return 1;
				    }
				    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Contract yourself!"); return 1; }
					GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					GetPlayerName(playerid, sendername, sizeof(sendername));
					playermoney = GetPlayerMoney(playerid);
					if (moneys > 0 && playermoney >= moneys)
					{
						SafeGivePlayerMoney(playerid, (0 - moneys));
						PlayerInfo[giveplayerid][pHeadValue]+=moneys;
						format(string, sizeof(string), "%s has placed a contract on %s, for $%d.",sendername, giveplayer, moneys);
						SendFamilyMessage(8, COLOR_YELLOW, string);
						format(string, sizeof(string), "* You placed a contract on %s, for $%d.",giveplayer, moneys);
						SendClientMessage(playerid, COLOR_WHITE, string);
						PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
					}
					else
					{
						SendClientMessage(playerid, COLOR_GRAD1, "   Invalid transaction amount.");
					}
				}
			}
			else
			{
				format(string, sizeof(string), "   %d is not an active player.", giveplayerid);
				SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	}
and get these errors iv tryed ******ing them but no luck
Код:
C:\Documents and Settings\gamer\My Documents\Downloads\SWRP.pwn(5204) : warning 217: loose indentation
C:\Documents and Settings\gamer\My Documents\Downloads\SWRP.pwn(5209) : warning 217: loose indentation
C:\Documents and Settings\gamer\My Documents\Downloads\SWRP.pwn(5217) : error 017: undefined symbol "playermoney"
C:\Documents and Settings\gamer\My Documents\Downloads\SWRP.pwn(5218) : error 017: undefined symbol "playermoney"
C:\Documents and Settings\gamer\My Documents\Downloads\SWRP.pwn(5220) : error 017: undefined symbol "SafeGivePlayerMoney"
C:\Documents and Settings\gamer\My Documents\Downloads\SWRP.pwn(5221) : error 017: undefined symbol "pHeadValue"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
please halp
Reply
#2

Nope. Don't copy & paste, you wont learn nothing and It's just noobish.
Reply
#3

Wow thanks that was very helpful!
i give it a -120/10
thanks for nothing!
Reply
#4

Here u are fixed playermoney error, SafeGivePlayerMoney(playerid, (0 - moneys)); must have a stock, If u get it from another script, copy the stock too


pawn Код:
if(strcmp(cmd, "/contract", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /contract [playerid/PartOfName] [amount]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /contract [playerid/PartOfName] [amount]");
                return 1;
            }
            moneys = strval(tmp);
            if(moneys < 1000 || moneys > 100000) { SendClientMessage(playerid, COLOR_GREY, "   Contract money must be atleast $1000, and not more then $100000!"); return 1; }
            if(PlayerInfo[playerid][pLevel] < 3)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "You must be level 3 to place a Contract.");
                return 1;
            }
            if (IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    if(PlayerInfo[playerid][pFaction] != 255 && FactionInfo[PlayerInfo[playerid][pFaction]][fType] == 12)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   Cannot place Contracts on your own Agency!");
                        return 1;
                    }
                     if(PlayerInfo[playerid][pFaction] != 255 && FactionInfo[PlayerInfo[playerid][pFaction]][fType] == 12)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   Cannot place Contracts on your own Agency!");
                        return 1;
                    }
                    if(PlayerInfo[giveplayerid][pFaction] != 255 && FactionInfo[PlayerInfo[giveplayerid][pFaction]][fType] == 12)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   Can't contract a Hitman !");
                        return 1;
                    }
                    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Contract yourself!"); return 1; }
                    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    new playermoney = GetPlayerMoney(playerid);
                    if (moneys > 0 && playermoney >= moneys)
                    {
                        SafeGivePlayerMoney(playerid, (0 - moneys));
                        PlayerInfo[giveplayerid][pHeadValue]+=moneys;
                        format(string, sizeof(string), "%s has placed a contract on %s, for $%d.",sendername, giveplayer, moneys);
                        SendFamilyMessage(8, COLOR_YELLOW, string);
                        format(string, sizeof(string), "* You placed a contract on %s, for $%d.",giveplayer, moneys);
                        SendClientMessage(playerid, COLOR_WHITE, string);
                        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GRAD1, "   Invalid transaction amount.");
                    }
                }
            }
            else
            {
                format(string, sizeof(string), "   %d is not an active player.", giveplayerid);
                SendClientMessage(playerid, COLOR_GRAD1, string);
            }
        }
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)