Why this message dont want to show ?
#1

PHP код:
new CarName[][] =
{
    
"Landstalker""Bravura""Buffalo""Linerunner""Perrenial""Sentinel",
    
"Dumper""Firetruck""Trashmaster""Stretch""Manana""Infernus",
    
"Voodoo""Pony""Mule""Cheetah""Ambulance""Leviathan""Moonbeam",
    
"Esperanto""Taxi""Washington""Bobcat""Whoopee""BF Injection",
    
"Hunter""Premier""Enforcer""Securicar""Banshee""Predator""Bus",
    
"Rhino""Barracks""Hotknife""Trailer""Previon""Coach""Cabbie",
    
"Stallion""Rumpo""RC Bandit""Romero""Packer""Monster""Admiral",
    
"Squalo""Seasparrow""Pizzaboy""Tram""Trailer""Turismo""Speeder",
    
"Reefer""Tropic""Flatbed""Yankee""Caddy""Solair""Berkley's RC Van",
    
"Skimmer""PCJ-600""Faggio""Freeway""RC Baron""RC Raider""Glendale",
    
"Oceanic","Sanchez""Sparrow""Patriot""Quad""Coastguard""Dinghy",
    
"Hermes""Sabre""Rustler""ZR-350""Walton""Regina""Comet""BMX",
    
"Burrito""Camper""Marquis""Baggage""Dozer""Maverick""News Chopper",
    
"Rancher""FBI Rancher""Virgo""Greenwood""Jetmax""Hotring""Sandking",
    
"Blista Compact""Police Maverick""Boxvillde""Benson""Mesa""RC Goblin",
    
"Hotring Racer A""Hotring Racer B""Bloodring Banger""Rancher""Super GT",
    
"Elegant""Journey""Bike""Mountain Bike""Beagle""Cropduster""Stunt",
    
"Tanker""Roadtrain""Nebula""Majestic""Buccaneer""Shamal""Hydra",
    
"FCR-900""NRG-500""HPV1000""Cement Truck""Tow Truck""Fortune",
    
"Cadrona""FBI Truck""Willard""Forklift""Tractor""Combine""Feltzer",
    
"Remington""Slamvan""Blade""Freight""Streak""Vortex""Vincent",
    
"Bullet""Clover""Sadler""Firetruck""Hustler""Intruder""Primo",
    
"Cargobob""Tampa""Sunrise""Merit""Utility""Nevada""Yosemite",
    
"Windsor""Monster""Monster""Uranus""Jester""Sultan""Stratium",
    
"Elegy""Raindance""RC Tiger""Flash""Tahoma""Savanna""Bandito",
    
"Freight Flat""Streak Carriage""Kart""Mower""Dune""Sweeper",
    
"Broadway""Tornado""AT-400""DFT-30""Huntley""Stafford""BF-400",
    
"News Van""Tug""Trailer""Emperor""Wayfarer""Euros""Hotdog""Club",
    
"Freight Box""Trailer""Andromada""Dodo""RC Cam""Launch""Police Car",
    
"Police Car""Police Car""Police Ranger""Picador""S.W.A.T""Alpha",
    
"Phoenix""Glendale""Sadler""Luggage""Luggage""Stairs""Boxville",
    
"Tiller""Utility Trailer"
}; 
PHP код:
       new vid1 GetPlayerVehicleID(PlayerInfo[playerb][pVeh]);
       new 
vid2 GetPlayerVehicleID(PlayerInfo[playerb][pVVeh]);
       new 
vid3 GetPlayerVehicleID(PlayerInfo[playerb][pVVVeh]);
       new 
vid4 GetPlayerVehicleID(PlayerInfo[playerb][pVVVVeh]);
    new 
string[256], gender[8], Float:HFloat:A
PHP код:
    format(stringsizeof(string), "Vehicles: 1[%s (ID:%d) - 2[%s (ID:%d)] - 3[%s (ID:%d)] - 4[%s (ID:%d)]"RVN(GetVehicleModel(PlayerInfo[playerb][pVeh])), CarName[GetVehicleModel(vid1)-400], RVN(GetVehicleModel(PlayerInfo[playerb][pVVeh])), CarName[GetVehicleModel(vid2)-400], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVeh])), CarName[GetVehicleModel(vid3)-400], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVVeh])), CarName[GetVehicleModel(vid4)-400]);
    
SendClientMessage(playeridCOLOR_RADIOstring); 
The compiler dont gives warnings or errors....
When player use the cmd it just dont shows.Dont sayd Unknown cmd or something
Reply
#2

The arguments are wrong. CarName[...] is string; thus it uses %s placeholder (you used %d).
I don't know what RVN is going to return.

Also, checking if the modelid is valid before subtracting 400 is a must if you want to get rid of run time errors.
Reply
#3

I removed
CarName[GetVehicleModel(vid1)-400]
CarName[GetVehicleModel(vid2)-400]
CarName[GetVehicleModel(vid3)-400]
And it works so the problem is in this....
How to fix the arguments ?
Reply
#4

There are a few models you're not subtracting 400 from.
Reply
#5

What did you mean ?
Reply
#6

BUMP
Reply
#7

b u m p
Reply
#8

Can you actually show us the whole command? And perhaps the RVN function just to be useful...
Reply
#9

Its a stock
Quote:

stock ShowStats(playerid, playerb)
{
new string[256], gender[8], Float:H, Float:A;
// Gender
if(PlayerInfo[playerb][pGender] == 1) format(gender, sizeof(gender), "Male");
else if(PlayerInfo[playerb][pGender] == 2) format(gender, sizeof(gender), "Female");
// Health and Armor
GetPlayerHealth(playerb, H); GetPlayerArmour(playerb, A);
// Total Wealth
//new idx = PlayerInfo[playerb][pHouse];
//new idx2 = PlayerInfo[playerb][pBiz];
//new TotalWealth = PlayerInfo[playerb][pMoney]+PlayerInfo[playerb][pBank]+HouseInfo[idx][hMoney]+BizInfo[idx2][bMoney];
// Loyal
new loyal[4];
if(!PlayerInfo[playerb][pLoyal]) format(loyal, sizeof(loyal), "Yes");
if(PlayerInfo[playerb][pLoyal]) format(loyal, sizeof(loyal), "No");
// Oldskool
new oldskool[4];
if(PlayerInfo[playerid][pHours] >= 24 format(oldskool, sizeof(oldskool), "Yes");
else if(PlayerInfo[playerid][pHours] < 24 format(oldskool, sizeof(oldskool), "No");
//fac-fam rank
new rank[128];
if(PlayerInfo[playerb][pFac] >= 1) format(rank, sizeof(rank), "%s", RPFRN(playerb));
else format(rank, sizeof(rank), "None");
//fac-fam
new org[128];
if(PlayerInfo[playerb][pFac] >= 1) format(org, sizeof(org), "%s", RPFNEx(playerb));
else format(org, sizeof(org), "None");
//
new rank2[128];
if(PlayerInfo[playerb][pFam] >=1) format(rank2, sizeof(rank2), "%s", RPFaRN(playerb));
else format(rank2, sizeof(rank2), "None");
//fac-fam
new org2[128];
if(PlayerInfo[playerb][pFam] >=1) format(org2, sizeof(org2), "%s", RPFaN(playerb));
else format(org2, sizeof(org2), "None");
new exp = PlayerInfo[playerb][pExp];
new nxtlevel = PlayerInfo[playerb][pLevel]+1;
new expamount = nxtlevel*4;
new costlevel = nxtlevel*4000;//10k for testing purposes
/*//respect
new respectneed[4];
if(PlayerInfo[playerb][pLevel] == 1) format(respectneed, sizeof(respectneed), "4");
else if(PlayerInfo[playerb][pLevel] == 2) format(respectneed, sizeof(respectneed), "10");
else if(PlayerInfo[playerb][pLevel] == 3) format(respectneed, sizeof(respectneed), "18");
else if(PlayerInfo[playerb][pLevel] == 4) format(respectneed, sizeof(respectneed), "30");
else if(PlayerInfo[playerb][pLevel] == 5) format(respectneed, sizeof(respectneed), "42");
else if(PlayerInfo[playerb][pLevel] == 6) format(respectneed, sizeof(respectneed), "54");
else if(PlayerInfo[playerb][pLevel] == 7) format(respectneed, sizeof(respectneed), "70");
else if(PlayerInfo[playerb][pLevel] == format(respectneed, sizeof(respectneed), "88");
else if(PlayerInfo[playerb][pLevel] == 9) format(respectneed, sizeof(respectneed), "108");
else if(PlayerInfo[playerb][pLevel] == 10) format(respectneed, sizeof(respectneed), "130");
else if(PlayerInfo[playerb][pLevel] == 11) format(respectneed, sizeof(respectneed), "154");
else if(PlayerInfo[playerb][pLevel] == 12) format(respectneed, sizeof(respectneed), "180");
else if(PlayerInfo[playerb][pLevel] == 13) format(respectneed, sizeof(respectneed), "208");
else if(PlayerInfo[playerb][pLevel] == 14) format(respectneed, sizeof(respectneed), "238");
else if(PlayerInfo[playerb][pLevel] == 15) format(respectneed, sizeof(respectneed), "270");
else if(PlayerInfo[playerb][pLevel] == 16) format(respectneed, sizeof(respectneed), "304");
else if(PlayerInfo[playerb][pLevel] == 17) format(respectneed, sizeof(respectneed), "340");
else if(PlayerInfo[playerb][pLevel] == 1 format(respectneed, sizeof(respectneed), "378");
else if(PlayerInfo[playerb][pLevel] == 19) format(respectneed, sizeof(respectneed), "418");
else if(PlayerInfo[playerb][pLevel] == 20) format(respectneed, sizeof(respectneed), "460");
else if(PlayerInfo[playerb][pLevel] == 21) format(respectneed, sizeof(respectneed), "504");
else if(PlayerInfo[playerb][pLevel] == 22) format(respectneed, sizeof(respectneed), "550");
else if(PlayerInfo[playerb][pLevel] == 23) format(respectneed, sizeof(respectneed), "598");
else if(PlayerInfo[playerb][pLevel] == 24) format(respectneed, sizeof(respectneed), "648");
else if(PlayerInfo[playerb][pLevel] == 25) format(respectneed, sizeof(respectneed), "700");
else if(PlayerInfo[playerb][pLevel] == 26) format(respectneed, sizeof(respectneed), "754");
else if(PlayerInfo[playerb][pLevel] == 27) format(respectneed, sizeof(respectneed), "810");
else if(PlayerInfo[playerb][pLevel] == 2 format(respectneed, sizeof(respectneed), "868");
else if(PlayerInfo[playerb][pLevel] == 29) format(respectneed, sizeof(respectneed), "928");*/
//new average = (PlayerInfo[playerb][pTMinutes] / PlayerInfo[playerb][pDay]);
// Stats
SendClientMessage(playerid, COLOR_LIGHTRED, "_________________________________________________ ____");
format(string, sizeof(string), " Statistics of %s", RPN(playerb));
SendClientMessage(playerid, COLOR_ORANGE, string);
format(string, sizeof(string), "Level: [%d] - Gender: [%s] - Age: [%d] - Money: [$%d] - Bank: [$%d] - Health: [%0.1f] - Armor: [%0.1f]", PlayerInfo[playerb][pLevel], gender, PlayerInfo[playerb][pAge], PlayerInfo[playerb][pMoney], PlayerInfo[playerb][pBank], H, A);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "Phone Number: [%d] - Playing Hours: [%d] Next Level: [%d/%d] - Next Level Cost: [$%d] - Respect Points: [%d]", PlayerInfo[playerb][pNumber], PlayerInfo[playerb][pHours], exp, expamount, costlevel, PlayerInfo[playerb][pExp]);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "Occupation: [%s] - Wanted Level: [%d] - Crimes Committed: [%d] - Arrested: [%dx] - Kills: [%d] - Deaths: [%d]", RPJN(playerb), PlayerInfo[playerb][pWanted], PlayerInfo[playerb][pCrimes], PlayerInfo[playerb][pArrested], PlayerInfo[playerb][pKill], PlayerInfo[playerb][pDeath]);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "Faction: [%s] - Faction Rank: [%s] - Family: [%s] - Family Rank: [%s]", org, rank, org2, rank2);
SendClientMessage(playerid, COLOR_RADIO, string);
format(string, sizeof(string), "Business: [%s] - House: [%s] - Garage: [%s]", RBT(PlayerInfo[playerb][pBiz]), RPHK(playerb), RPGK(playerb), RVN(GetVehicleModel(PlayerInfo[playerb][pVeh])), PlayerInfo[playerb][pVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVeh])), PlayerInfo[playerb][pVVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVeh])), PlayerInfo[playerb][pVVVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVVeh])), PlayerInfo[playerb][pVVVVeh]);
SendClientMessage(playerid, COLOR_RADIO, string);
format(string, sizeof(string), "Vehicles: 1[%s (ID:%d) - 2[%s (ID:%d)] - 3[%s (ID:%d)] - 4[%s (ID:%d)]", RVN(GetVehicleModel(PlayerInfo[playerb][pVeh])), PlayerInfo[playerb][pVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVeh])), PlayerInfo[playerb][pVVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVeh])), PlayerInfo[playerb][pVVVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVVeh])), PlayerInfo[playerb][pVVVVeh]);
SendClientMessage(playerid, COLOR_RADIO, string);
return 1;
}

Reply
#10

Something weird is happening with my compiler, so I can't tell you if this gives errors or not.
pawn Код:
stock ShowStats(playerid, playerb)
{
    new string[150], gender[8], Float:H, Float:A, loyal[4], oldskool[4];
    // Gender
    format(gender, sizeof(gender), "%s", (PlayerInfo[playerb][pGender] == 1) ? ("Male") : ("Female"));
    // Health and Armor
    GetPlayerHealth(playerb, H);
    GetPlayerArmour(playerb, A);
    // Total Wealth
    //new TotalWealth = PlayerInfo[playerb][pMoney] + PlayerInfo[playerb][pBank] + HouseInfo[PlayerInfo[playerb][pHouse]][hMoney] + BizInfo[PlayerInfo[playerb][pBiz]][bMoney];
    // Loyal
    format(loyal, sizeof(loyal), "%s", (PlayerInfo[playerb][pLoyal]) ? ("Yes") : ("No"));
    // Oldskool
    format(oldskool, sizeof(oldskool), "%s", (PlayerInfo[playerid][pHours] >= 24) ? ("Yes") : ("No"));
    //fac-fam rank
    new rank[20], org[20], rank2[20], org2[20];
    format(rank, sizeof(rank), "%s", (PlayerInfo[playerb][pFac] >= 1) ? (RPFRN(playerb)) : ("None"));
    format(org, sizeof(org), "%s", (PlayerInfo[playerb][pFac] >= 1) ? (RPFNEx(playerb)) : ("None"));
    format(rank2, sizeof(rank2), "%s", (PlayerInfo[playerb][pFam] >= 1) ? (RPFaRN(playerb)) : ("None"));
    format(org2, sizeof(org2), "%s", (PlayerInfo[playerb][pFam] >= 1) ? (RPFaN(playerb)) : ("None"));
    /*//respect
    new respectneed;
    switch(PlayerInfo[playerb][pLevel])
    {
        case 1: respectneed = 4;
        case 2: respectneed = 10;
        case 3: respectneed = 18;
        case 4: respectneed = 30;
        case 5: respectneed = 42;
        case 6: respectneed = 54;
        case 7: respectneed = 70;
        case 8: respectneed = 88;
        case 9: respectneed = 108;
        case 10: respectneed = 130;
        case 11: respectneed = 154;
        case 12: respectneed = 180;
        case 13: respectneed = 208;
        case 14: respectneed = 238;
        case 15: respectneed = 270;
        case 16: respectneed = 304;
        case 17: respectneed = 340;
        case 18: respectneed = 378;
        case 19: respectneed = 418;
        case 20: respectneed = 460;
        case 21: respectneed = 504;
        case 22: respectneed = 550;
        case 23: respectneed = 598;
        case 24: respectneed = 648;
        case 25: respectneed = 700;
        case 26: respectneed = 754;
        case 27: respectneed = 810;
        case 28: respectneed = 868;
        case 29: respectneed = 928;
    }*/

    //new average = (PlayerInfo[playerb][pTMinutes] / PlayerInfo[playerb][pDay]);
    //Stats
    SendClientMessage(playerid, COLOR_LIGHTRED, "______________________________________________________");
    format(string, sizeof(string), " Statistics of %s", RPN(playerb));
    SendClientMessage(playerid, COLOR_ORANGE, string);
    format(string, sizeof(string), "Level: [%d] - Gender: [%s] - Age: [%d] - Money: [$%d] - Bank: [$%d] - Health: [%0.1f] - Armor: [%0.1f]", PlayerInfo[playerb][pLevel], gender, PlayerInfo[playerb][pAge], PlayerInfo[playerb][pMoney], PlayerInfo[playerb][pBank], H, A);
    SendClientMessage(playerid, COLOR_LIGHTRED, string);
    format(string, sizeof(string), "Phone Number: [%d] - Playing Hours: [%d] Next Level: [%d/%d] - Next Level Cost: [$%d] - Respect Points: [%d]", PlayerInfo[playerb][pNumber], PlayerInfo[playerb][pHours], PlayerInfo[playerb][pExp], ((PlayerInfo[playerb][pLevel] + 1) * 4), ((PlayerInfo[playerb][pLevel] + 1) * 4000), PlayerInfo[playerb][pExp]);
    SendClientMessage(playerid, COLOR_LIGHTRED, string);
    format(string, sizeof(string), "Occupation: [%s] - Wanted Level: [%d] - Crimes Committed: [%d] - Arrested: [%dx] - Kills: [%d] - Deaths: [%d]", RPJN(playerb), PlayerInfo[playerb][pWanted], PlayerInfo[playerb][pCrimes], PlayerInfo[playerb][pArrested], PlayerInfo[playerb][pKill], PlayerInfo[playerb][pDeath]);
    SendClientMessage(playerid, COLOR_WHITE, string);
    format(string, sizeof(string), "Faction: [%s] - Faction Rank: [%s] - Family: [%s] - Family Rank: [%s]", org, rank, org2, rank2);
    SendClientMessage(playerid, COLOR_RADIO, string);
    format(string, sizeof(string), "Business: [%s] - House: [%s] - Garage: [%s]", RBT(PlayerInfo[playerb][pBiz]), RPHK(playerb), RPGK(playerb), RVN(GetVehicleModel(PlayerInfo[playerb][pVeh])), PlayerInfo[playerb][pVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVeh])), PlayerInfo[playerb][pVVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVeh])), PlayerInfo[playerb][pVVVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVVeh])), PlayerInfo[playerb][pVVVVeh]);
    SendClientMessage(playerid, COLOR_RADIO, string);
    format(string, sizeof(string), "Vehicles: 1[%s (ID:%d)] - 2[%s (ID:%d)] - 3[%s (ID:%d)] - 4[%s (ID:%d)]", RVN(GetVehicleModel(PlayerInfo[playerb][pVeh])), PlayerInfo[playerb][pVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVeh])), PlayerInfo[playerb][pVVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVeh])), PlayerInfo[playerb][pVVVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVVeh])), PlayerInfo[playerb][pVVVVeh]);
    SendClientMessage(playerid, COLOR_RADIO, string);
    return 1;
}
Show us how you are USING the stats function, in a command? In a callback? If so, please show us the command/callback.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)