Stores coordinates error.
#1

Hello.
I need help.

This is my declaration of Stores:

pawn Код:
new Stores[11][3] = {
{-27.312299,-29.277599,1003.557250},
{-25.132598,-139.066986,1003.546875},
{-30.946699,-89.609596,1003.546875},
{6.091179,-29.271898,1003.549438},
{-25.884498,-185.868988,1003.546875},
{207.737991,-109.019996,1005.132812},
{161.391006,-93.159156,1001.804687}
{501.980987,-69.150199,998.757812},
{373.825653,-117.270904,1001.499511},
{369.579528,-4.487294,1001.858886},
{373.825653,-117.270904,1001.499511},
};
This is my command:
pawn Код:
if(strcmp(cmd, "/robstore", true) == 0)
    {
                if(!PlayerToPoint(6.0, playerid, Stores))
 {
 SendClientMessage(playerid, COLOR_RED, "You have to be at a store.");
 }
                if(PlayerToPoint(6.0, playerid, Stores))
{
            if(RobbedTime[playerid] == 1)
            {
   SendClientMessage(playerid, COLOR_YELLOW, "You can only rob a store once after logging in!");
            }
            if(RobbedTime[playerid] == 0)
          {

                GetPlayerName(playerid, sendername, sizeof(sendername));
                new robmoney = random(30000);
            SendClientMessage(playerid, 0xFF0000FF, " You have robbed a store.");
                RobbedTime[playerid] = 1;
                format(string, sizeof(string), "** HQ: A store in Las Venturas has been robbed!!!!!. **", sendername);
                SendRadioMessage(1, TEAM_BLUE_COLOR, string);
  WantedPoints[playerid] =20; SetPlayerCriminal(playerid,255, "Robbing a store");
                format(string,sizeof(string), "* %s shouts 'GET DOWN THE FLOOR' as he robs a store.", sendername);
                SendClientMessage(playerid, COLOR_YELLOW, "You have been seen on the security cameras! Run away!");
                ProxDetector(30.0, playerid, string, COLOR_DARKBLUE,COLOR_DARKBLUE,COLOR_DARKBLUE,COLOR_DARKBLUE,COLOR_DARKBLUE);
                format(string, sizeof(string), "** You have successfully stolen $%d!",robmoney);
                SendClientMessage(playerid,COLOR_YELLOW,string);
                GivePlayerMoney(playerid, robmoney);
            }
 }
        return 1;
    }
This is my PlayerToPoint function:
pawn Код:
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
  if(IsPlayerConnected(playerid))
    {
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        tempposx = (oldposx -x);
        tempposy = (oldposy -y);
        tempposz = (oldposz -z);
        //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
        if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
        {
            return 1;
        }
    }
    return 0;
}
This is my error:
Quote:

C:\Users\Monica\Desktop\samp\Chrham's RPG\samp02Xserver.win32\gamemodes\gf.pwn(14823) : error 035: argument type mismatch (argument 3)
C:\Users\Monica\Desktop\samp\Chrham's RPG\samp02Xserver.win32\gamemodes\gf.pwn(14827) : error 035: argument type mismatch (argument 3)

How do i solve this
Reply
#2

This should work:

pawn Код:
if(strcmp(cmd, "/robstore", true) == 0)
    {
        for(new i=0; i < sizeof(Stores); i++)
        {
            if(PlayerToPoint(6.0, playerid, Stores[i][0], Stores[i][1], Stores[i][2]))
            {
                if(RobbedTime[playerid] == 1)
                {
                    SendClientMessage(playerid, COLOR_YELLOW, "You can only rob a store once after logging in!");
                }
                if(RobbedTime[playerid] == 0)
                {
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    new robmoney = random(30000);
                    SendClientMessage(playerid, 0xFF0000FF, " You have robbed a store.");
                    RobbedTime[playerid] = 1;
                    format(string, sizeof(string), "** HQ: A store in Las Venturas has been robbed!!!!!. **", sendername);
                    SendRadioMessage(1, TEAM_BLUE_COLOR, string);
                    WantedPoints[playerid] =20; SetPlayerCriminal(playerid,255, "Robbing a store");
                    format(string,sizeof(string), "* %s shouts 'GET DOWN THE FLOOR' as he robs a store.", sendername);
                    SendClientMessage(playerid, COLOR_YELLOW, "You have been seen on the security cameras! Run away!");
                    ProxDetector(30.0, playerid, string, COLOR_DARKBLUE,COLOR_DARKBLUE,COLOR_DARKBLUE,COLOR_DARKBLUE,COLOR_DARKBLUE);
                    format(string, sizeof(string), "** You have successfully stolen $%d!",robmoney);
                    SendClientMessage(playerid,COLOR_YELLOW,string);
                    GivePlayerMoney(playerid, robmoney);
                    return 1;
                }
            }
        }
        SendClientMessage(playerid, COLOR_RED, "You have to be at a store.");
        return 1;
    }
Reply
#3

You forgot on in the sentence "GET DOWN THE FLOOR". ROFL.
Reply
#4

Quote:
Originally Posted by Abernethy
You forgot on in the sentence "GET DOWN THE FLOOR". ROFL.
Hhaha! Thanks xDD
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)