Small Help
#1

hola
im tired to make random 1 Race CP To Finish Mission
i got this error
Quote:

Bank.pwn(7 : warning 219: local variable "rand" shadows a variable at a preceding level
Bank.pwn(79) : warning 202: number of arguments does not match definition
Bank.pwn(79) : warning 202: number of arguments does not match definition
Bank.pwn(79) : warning 202: number of arguments does not match definition
Bank.pwn(87) : error 033: array must be indexed (variable "RandomCheckpoints")

Line (7
PHP код:
new rand random(sizeof(RandomCheckpoint)); 
Line (79)
PHP код:
RandomCheckpoints[playerid] = CreateDynamicRaceCP(playeridRandomCheckpoint[rand][0], RandomCheckpoint[rand][1], RandomCheckpoint[rand][2],3); 
Line (87)
PHP код:
public OnPlayerEnterDynamicRaceCP(playeridcheckpointid)
{
    if(
checkpointid == RandomCheckpoints)
    { 
Reply
#2

i already using
PHP код:
new Float:RandomCheckpoint[5][3] =
{
  {
760.2212,382.0151,23.1719},
  {-
771.9505,1435.4984,13.7891},
  {
3.0273,1345.4529,9.1719},
  {
207.2326,1860.7728,20.6406},
  {
418.8860,2530.0115,16.6193}
};
new 
RandomCheckpoints[MAX_PLAYERS]; 
Reply
#3

PHP код:
new ran random(sizeof(RandomCheckpoint));  //No Errors, just a warning, meaning you already have the word "rand" already change it, or re-use the old one.
RandomCheckpoints[playerid] = CreateDynamicRaceCP(playeridRandomCheckpoint[rand][0], RandomCheckpoint[rand][1], RandomCheckpoint[rand][2], 0.00.00.05.0, -1, -1, -150.0);  
public 
OnPlayerEnterDynamicRaceCP(playeridcheckpointid

    if(
checkpointid == RandomCheckpoints[playerid])//Missing the [playerid] 
    

Код:
CreateDynamicRaceCP(type, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Float:size, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_RACE_CP_SD, STREAMER_TAG_AREA areaid = STREAMER_TAG_AREA -1)
Reply
#4

Well, let's start from the scratch.

What do you understand from the following paragraph?

Quote:

local variable "rand" shadows a variable at a preceding level

Reply
#5

Quote:
Originally Posted by ISmokezU
Посмотреть сообщение
PHP код:
new ran random(sizeof(RandomCheckpoint));  //No Errors, just a warning, meaning you already have the word "rand" already change it, or re-use the old one.
RandomCheckpoints[playerid] = CreateDynamicRaceCP(playeridRandomCheckpoint[rand][0], RandomCheckpoint[rand][1], RandomCheckpoint[rand][2], 0.00.00.05.0, -1, -1, -150.0);  
public 
OnPlayerEnterDynamicRaceCP(playeridcheckpointid

    if(
checkpointid == RandomCheckpoints[playerid])//Missing the [playerid] 
    

Код:
CreateDynamicRaceCP(type, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Float:size, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_RACE_CP_SD, STREAMER_TAG_AREA areaid = STREAMER_TAG_AREA -1)
error
Quote:

(7 : warning 219: local variable "rand" shadows a variable at a preceding level

Line (7
PHP код:
new rand random(sizeof(RandomCheckpoint)); 
Reply
#6

Re - Read My Post. Sorry.

"//Not an Error, Just a Warning, Meaning You Already Have the Word "Rand" Already. Either Change It, or Re-Use the Old One. "
Reply
#7

Quote:
Originally Posted by ISmokezU
Посмотреть сообщение
Re - Read My Post. Sorry.

"//Not an Error, Just a Warning, Meaning You Already Have the Word "Rand" Already. Either Change It, or Re-Use the Old One. "
i tired the 2 still same problem
Reply
#8

What's it saying now?

PHP код:
new random(sizeof(RandomCheckpoint));  //No Errors, just a warning, meaning you already have the word "rand" already change it, or re-use the old one. 
RandomCheckpoints[playerid] = CreateDynamicRaceCP(playeridRandomCheckpoint[z][0], RandomCheckpoint[z][1], RandomCheckpoint[z][2], 0.00.00.05.0, -1, -1, -150.0);   
public 
OnPlayerEnterDynamicRaceCP(playeridcheckpointid)  
{  
    if(
checkpointid == RandomCheckpoints[playerid])//Missing the [playerid]  
    

Reply
#9

[QUOTE=ISmokezU;3860397]What's it saying now?

Quote:

(77) : warning 204: symbol is assigned a value that is never used: "ran"

PHP код:
new ran random(sizeof(RandomCheckpoint)); 
still error
i tired to delete it Complie No Errors but RaceCP not showing
Reply
#10

Quote:
Originally Posted by ISmokezU
Посмотреть сообщение
What's it saying now?

PHP код:
new random(sizeof(RandomCheckpoint));  //No Errors, just a warning, meaning you already have the word "rand" already change it, or re-use the old one. 
RandomCheckpoints[playerid] = CreateDynamicRaceCP(playeridRandomCheckpoint[z][0], RandomCheckpoint[z][1], RandomCheckpoint[z][2], 0.00.00.05.0, -1, -1, -150.0);   
public 
OnPlayerEnterDynamicRaceCP(playeridcheckpointid)  
{  
    if(
checkpointid == RandomCheckpoints[playerid])//Missing the [playerid]  
    

PHP код:
new random(sizeof(RandomCheckpoint));  //No Errors, just a warning, meaning you already have the word "rand" 
now my complie working with out error but the RaceCP Not Showing Why ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)