new RandomT = random(4); switch(RandomT) { case 0: { return 1276; } case 1: { return 1550; } case 2: { return 1210; } case 3: { return 2710; } case 4: { return 1247; } } ObiectTreasure = CreatePickup(RandomT, 21, gRandomPositions[rand][0], gRandomPositions[rand][1], gRandomPositions[rand][2]);
static const randobj[] =
{
1276, 1550, 1210, 1270, 1247
};
ObiectTreasure = CreateObject(random(sizeof(randobj)), //rest code
You could do like this:
PHP код:
|
C:\Program Files (x86)\Server_Samp\Gamemode-uri\Pear\gamemodes\Pear.pwn(15064) : warning 202: number of arguments does not match definition C:\Program Files (x86)\Server_Samp\Gamemode-uri\Pear\gamemodes\Pear.pwn(15064) : warning 202: number of arguments does not match definition C:\Program Files (x86)\Server_Samp\Gamemode-uri\Pear\gamemodes\Pear.pwn(15064) : warning 202: number of arguments does not match definition C:\Program Files (x86)\Server_Samp\Gamemode-uri\Pear\gamemodes\Pear.pwn(15064) : warning 202: number of arguments does not match definition C:\Program Files (x86)\Server_Samp\Gamemode-uri\Pear\gamemodes\Pear.pwn(15064) : error 001: expected token: ",", but found ";" C:\Program Files (x86)\Server_Samp\Gamemode-uri\Pear\gamemodes\Pear.pwn(15062) : warning 203: symbol is never used: "RandomT" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
ObiectTreasure = CreatePickup(random(sizeof(randobj)), 21, gRandomPositions[rand][0], gRandomPositions[rand][1], gRandomPositions[rand][2]);
PHP код:
|
static const RandomT[] = { 1276, 1550, 1210, 1270, 1247 }; ObiectTreasure = CreatePickup(random(sizeof(RandomT)), 21, gRandomPositions[rand][0], gRandomPositions[rand][1], gRandomPositions[rand][2]);
ObiectTreasure = CreatePickup(RandomT[random(sizeof(RandomT))], 21, gRandomPositions[rand][0], gRandomPositions[rand][1], gRandomPositions[rand][2]);
ohh sorry my bad
PHP код:
|