what is wrong i try to complie
#1

new PlayerDice[MAX_PLAYERS][3],PlayerDiceTotal[MAX_PLAYERS],PlayerDiceWager[MAX_PLAYERS];

stock RandomEx(min, max)
{
return random(max - min) + min;
}

COMMAND:dice(playerid, params[])
{
if (PlayerInfo[playerid][pSpawned] == 1)
{
new idx,string[256],tmp[256],Players,TargetId;

if (PlayerInfo[playerid][pDiceOfferedTo] > -1)
{
SendClientMessage(playerid, COLOR_ERROR, "You Gambling Addict! Please Wait Before Offering A Game Of Dice.");
return 1;
}

if (PlayerInfo[playerid][pDiceOfferedBy] > -1)
{
TargetId = PlayerInfo[playerid][pDiceOfferedBy];

if (PlayerInfo[TargetId][pSpawned] == 0)
{
format(string, sizeof(string), "%s (%d) Is Dead. You Cannot Gamble With %s.",PlayerInfo[TargetId][pName],TargetId,ObjectGenderPronouns[PlayerInfo[TargetId][pGender]]);
SendClientMessage(playerid, COLOR_ERROR, string);
return 1;
}


if (GetDistanceBetweenPlayers(playerid,TargetId) > 5)
{
format(string, sizeof(string), "%s (%s) Is Not Close Enough. You Cannot Play Dice With %s.",PlayerInfo[TargetId][pName],TargetId,ObjectGenderPronouns[PlayerInfo[TargetId][pGender]]);
SendClientMessage(playerid, COLOR_ERROR, string);
return 1;
}

if (GetPlayerCash(playerid) < PlayerDiceWager[TargetId])
{
format(string, sizeof(string), "You Cannot Afford To Play Dice With %s (%d) For ($500).",PlayerInfo[playerid][pName],playerid,ObjectGenderPronouns[PlayerInfo[playerid][pGender]]);
SendClientMessage(TargetId, COLOR_ERROR, string);
return 1;
}

if (PlayerInfo[playerid][pJailed] == 0 && PlayerInfo[TargetId][pJailed] == 1)
{
format(string, sizeof(string), "%s (%d) Is In Jail. You Cannot Play Dice With %s.",PlayerInfo[TargetId][pName],TargetId,ObjectGenderPronouns[PlayerInfo[TargetId][pGender]]);
SendClientMessage(playerid, COLOR_ERROR, string);
return 1;
}

PlayerDice[playerid][1] = RandomEx(1, 9);if (PlayerDice[playerid][1] == 0)PlayerDice[playerid][1] = 1;
PlayerDice[playerid][2] = RandomEx(1, 9);if (PlayerDice[playerid][2] == 0)PlayerDice[playerid][2] = 1;


PlayerDiceTotal[playerid] = PlayerDice[playerid][1] + PlayerDice[playerid][2];
PlayerDiceTotal[TargetId] = PlayerDice[TargetId][1] + PlayerDice[TargetId][2];


format(string, sizeof(string), "%s (%d) Rolled A %d (%d and %d). You Rolled A %d (%d and %d).",PlayerInfo[TargetId][pName],TargetId,PlayerDiceTotal[TargetId],PlayerDice[TargetId][1],PlayerDice[TargetId][2],PlayerDiceTotal[playerid],PlayerDice[playerid][1],PlayerDice[playerid][2]);
SendClientMessage(playerid,COLOR_SERVER_HELP_MSG, string);

format(string, sizeof(string), "%s (%d) Rolled A %d (%d and %d). You Rolled A %d (%d and %d).",PlayerInfo[playerid][pName],playerid,PlayerDiceTotal[playerid],PlayerDice[playerid][1],PlayerDice[playerid][2],PlayerDiceTotal[TargetId],PlayerDice[TargetId][1],PlayerDice[TargetId][2]);
SendClientMessage(TargetId,COLOR_SERVER_HELP_MSG, string);

if (PlayerDiceTotal[playerid] > PlayerDiceTotal[TargetId])
{
format(string, sizeof(string), "Congratulations! You Won $%d from %s (%d).",PlayerDiceWager[TargetId],PlayerInfo[TargetId][pName],TargetId);
SendClientMessage(playerid,COLOR_SERVER_HELP_MSG, string);


ApplyAnimation(playerid,"CASINO","manwind", 2.7, 0, 0, 0, 0, 0, 0);


ApplyAnimation(TargetId,"CASINO","cards_lose", 2.7, 0, 0, 0, 0, 0, 0);

format(string, sizeof(string), "You Lost. %s (%d) Has Won $%d From You. Better Luck Next Time.",PlayerInfo[playerid][pName],playerid,PlayerDiceWager[TargetId]);
SendClientMessage(TargetId,COLOR_SERVER_HELP_MSG, string);

GiveCash(playerid,PlayerDiceWager[TargetId]);
GiveCash(TargetId,-PlayerDiceWager[TargetId]);
}


if (PlayerDiceTotal[playerid] < PlayerDiceTotal[TargetId])
{
format(string, sizeof(string), "You Lost. %s (%d) Has Won $%d From You. Better Luck Next Time.",PlayerInfo[TargetId][pName],TargetId,PlayerDiceWager[TargetId]);
SendClientMessage(playerid,COLOR_SERVER_HELP_MSG, string);

format(string, sizeof(string), "Congratulations! You Won $%d from %s (%d).",PlayerDiceWager[TargetId],PlayerInfo[playerid][pName],playerid);
SendClientMessage(TargetId,COLOR_SERVER_HELP_MSG, string);

ApplyAnimation(playerid,"CASINO","manwind", 2.7, 0, 0, 0, 0, 0, 0);


ApplyAnimation(TargetId,"CASINO","cards_lose", 2.7, 0, 0, 0, 0, 0, 0);

GiveCash(playerid,-PlayerDiceWager[TargetId]);
GiveCash(TargetId,PlayerDiceWager[TargetId]);
}
}
else
{
tmp = strtok(params, idx);

if (!strlen(tmp))
{

for (new i = 0; i < GetMaxPlayers(); i++)
{
if (IsPlayerConnected(i) && i != playerid && !IsPlayerNPC(i) && PlayerInfo[i][pSpawned] == 1 && GetDistanceBetweenPlayers(playerid,i) < 10)
{

if (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
{
Players ++;
}

if (Players > 0)TargetId = i; break;
}
}

if (Players == 0)
return SendClientMessage(playerid, COLOR_ERROR, "No One Close Enough To Play Dice With.");
}
else
{
if (!isNumeric(tmp))
{
TargetId = ReturnUser(tmp, playerid);

if (TargetId == INVALID_PLAYER_ID)
{
return 1;
}
}
else
{
TargetId = strval(tmp);

if (!IsPlayerConnected(TargetId))
{
format(string, sizeof(string), "That Player Is Not Connected.");
SendClientMessage(playerid, COLOR_ERROR, string);
return 1;
}
}
}

tmp = strtok(params, idx);


if (!strlen(tmp))
{
PlayerDiceWager[playerid] = 500;
}else{

if (!isNumeric(tmp))
{
SendClientMessage(playerid, COLOR_ERROR, "Invalid Amount. Please Enter A Numerical Character.");
return 1;
}
PlayerDiceWager[playerid] = strval(tmp);
}


if (PlayerDiceWager[playerid] < 500 || PlayerDiceWager[playerid] >300000)
{
format(string, sizeof(string), "Invalid Wager $%d Minimun Wager: $500 Maximum Wager: $300000",PlayerDiceWager[playerid]);
SendClientMessage(playerid, COLOR_ERROR, string);
return 1;
}

if (TargetId == playerid)
{
SendClientMessage(playerid, COLOR_ERROR, "You Cannot Play Dice With Yourself.");
return 1;
}

if (PlayerInfo[TargetId][pSpawned] == 0)
{
format(string, sizeof(string), "%s (%d) Is Dead. You Cannot Gamble With %s.",PlayerInfo[TargetId][pName],TargetId,ObjectGenderPronouns[PlayerInfo[TargetId][pGender]]);
SendClientMessage(playerid, COLOR_ERROR, string);
return 1;
}


if (PlayerInfo[playerid][pJailed] == 0 && PlayerInfo[TargetId][pJailed] == 1)
{
format(string, sizeof(string), "%s (%d) Is In Jail. You Cannot Play Dice With %s.",PlayerInfo[TargetId][pName],TargetId,ObjectGenderPronouns[PlayerInfo[TargetId][pGender]]);
SendClientMessage(playerid, COLOR_ERROR, string);
return 1;
}

if (PlayerInfo[playerid][pJailed] == 1 && PlayerInfo[TargetId][pJailed] == 0)
{
format(string, sizeof(string), "%s (%d) Is Not In Jail. You Cannot Play Dice With %s.",PlayerInfo[TargetId][pName],TargetId,ObjectGenderPronouns[PlayerInfo[TargetId][pGender]]);
SendClientMessage(playerid, COLOR_ERROR, string);
return 1;
}

if (GetDistanceBetweenPlayers(playerid,TargetId) > 5)
{
format(string, sizeof(string), "%s (%s) Is Not Close Enough. You Cannot Play Dice With %s.",PlayerInfo[TargetId][pName],TargetId,ObjectGenderPronouns[PlayerInfo[TargetId][pGender]]);
SendClientMessage(playerid, COLOR_ERROR, string);
return 1;
}

if (GetPlayerCash(playerid) < PlayerDiceWager[playerid])
{
format(string, sizeof(string), "You Cannot Afford To Play Dice For $%d.",PlayerDiceWager[playerid]);
SendClientMessage(playerid, COLOR_ERROR, string);
return 1;
}

format(string, sizeof(string), "You Have Asked %s (%d) To Play A Game Of Dice $%d. Wait To See If %s Will Accept.",PlayerInfo[TargetId][pName],TargetId,PlayerDiceWager[playerid],SubjectGenderPronouns[PlayerInfo[TargetId][pGender]]);
SendClientMessage(playerid, COLOR_SERVER_HELP_MSG, string);

format(string, sizeof(string), "~w~ASKED %s TO PLAY DICE~n~FOR $%d", PlayerInfo[TargetId][pName],PlayerDiceWager[playerid]);
SendGameText(playerid, string);

format(string, sizeof(string), "%s (%d) Has Asked You To Play A Dice Game For $%d. Type /dice to Play With %s.",PlayerInfo[playerid][pName],playerid,PlayerDiceWager[playerid],ObjectGenderPronouns[PlayerInfo[TargetId][pGender]]);
SendClientMessage(TargetId,COLOR_SERVER_HELP_MSG, string);
format(string, sizeof(string), "~w~%s HAS ASKED YOU TO~n~PLAY DICE FOR $%d~n~TYPE ~y~/DICE ~w~TO PLAY", PlayerInfo[playerid][pName],PlayerDiceWager[playerid]);
SendGameText(TargetId, string);

PlayerDice[playerid][1] = RandomEx(1, 9);if (PlayerDice[playerid][1] == 0)PlayerDice[playerid][1] = 1;
PlayerDice[playerid][2] = RandomEx(1, 9);if (PlayerDice[playerid][2] == 0)PlayerDice[playerid][2] = 1;

PlayerInfo[playerid][pDiceWaitTime] = 30;
PlayerInfo[TargetId][pDiceWaitTime] = 30;

PlayerInfo[playerid][pDiceOfferedTo] = TargetId;
PlayerInfo[TargetId][pDiceOfferedBy] = playerid;
}
}
else
SendClientMessage(playerid, COLOR_ERROR, "You Cannot Use This Command When You're Dead.");
return 1;
}
//================================================== ================================================== =======================================
//================================================== ================================================== =======================================

//================================================== ================================================== =======================================
//================================================== ================================================== =======================================
Reply
#2

Please use [code] or [php] tags, or use Pastebin.
Reply
#3

okay so when i go to paste bin what settings should i use? like create new pastebin settings
Reply
#4

didnt work still this C:\Users\Linus\Desktop\Freeroam & Roleplay v0.1 - RAR\Freeroam & Roleplay v0.1 - RAR\filterscripts\Diceme.pwn(1) : error 017: undefined symbol "MAX_PLAYERS"
C:\Users\Linus\Desktop\Freeroam & Roleplay v0.1 - RAR\Freeroam & Roleplay v0.1 - RAR\filterscripts\Diceme.pwn(247) : warning 203: symbol is never used: "dice"
C:\Users\Linus\Desktop\Freeroam & Roleplay v0.1 - RAR\Freeroam & Roleplay v0.1 - RAR\filterscripts\Diceme.pwn(247) : error 013: no entry point (no public functions)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#5

use the BBcode [code] or [php] around the codes you posted so we can read it and recognize the error
Reply
#6

error 013: no entry point (no public functions)

PHP код:
public OnGameModeInit() { return 1; } public OnGameModeExit() { return 1; } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)