- 0
Erori la compilarea GM-ului ("strtok" "tmp")
-
Similar Content
-
- 0 replies
- 217 views
-
- 22 replies
- 1,376 views
-
- 4 replies
- 576 views
-
- 1 reply
- 651 views
-
- 1 reply
- 480 views
-
-
Recently Browsing 0 members
- No registered users viewing this page.
Question
xblake
Buna ziua, nu ma ajutat nimeni pana acum asa ca am revenit cu un nou topic si sper sa va dati putin interesul.
La compilarea GameMode-ului primesc de 26 de ori urmatoarele erori:
[pawn]C:\Documents and Settings\Ady\Desktop\LinkLands powered by squiz\gamemodes\squiz.pwn(20852) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Ady\Desktop\LinkLands powered by squiz\gamemodes\squiz.pwn(20852) : error 033: array must be indexed (variable "tmp")[/pawn]
Linia 20852 din GameMode se afla in comanda /pay. Aici aveti codul:
[pawn]if(strcmp(cmd, "/pay", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /pay [playerid/PartOfName] [amount]");
return 1;
}
//giveplayerid = strval(tmp);
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /pay [playerid/PartOfName] [amount]");
return 1;
}
moneys = strval(tmp);
if(moneys > 1000 && PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, "You must be level 3 to pay over 1000");
return 1;
}
if(moneys < 1 || moneys > 99999)
{
SendClientMessage(playerid, COLOR_GRAD1, "Dont go below 1, or above 99999 at once.");
return 1;
}
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pLocal] == 106)
{
SendClientMessage(playerid, COLOR_GRAD1, "Command not allowed in this location");
return 1;
}
if (ProxDetectorS(5.0, playerid, giveplayerid))
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = GetPlayerMoney(playerid);
if (moneys > 0 && playermoney >= moneys)
{
ConsumingMoney[giveplayerid] = 1;
GivePlayerMoney(playerid, (0 - moneys));
GivePlayerMoney(giveplayerid, moneys);
format(string, sizeof(string), "You have sent %s(player: %d), $%d.", giveplayer,giveplayerid, moneys);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GRAD1, string);
format(string, sizeof(string), "You have recieved $%d from %s(player: %d).", moneys, sendername, playerid);
SendClientMessage(giveplayerid, COLOR_GRAD1, string);
format(string, sizeof(string), "%s has paid $%d to %s", sendername, moneys, giveplayer);
PayLog(string);
if(moneys >= 1000000)
{
ABroadCast(COLOR_YELLOW,string,1);
}
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "* %s takes out some cash, and hands it to %s.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ApplyAnimation(playerid,"DEALER","shop_pay",4.1,0,0,0,0,0);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Invalid transaction amount.");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Your too far away.");
}
}//invalid id
}
else
{
format(string, sizeof(string), "%d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
[/pawn]
Includeurile necesare la compile sunt:
[pawn]#include <a_samp>
#include <core>
#include <float>
#include <time>
#include <file>
#include <utils>
#include <morphinc>
#include <streamer>
#include <yom_buttons>
#include <JunkBuster>[/pawn]
Am compilat cu Pawno 0.3c folosind urmatoarele includeuri:
(Download) => http://solidfiles.com/d/7316d/
In GameMode la inceputul scriptului scrie acest mesaj:
[pawn]////////////////////////////////////////////////////////////////
/// ATENTION: THIS GM NEED A 0.3a PAWN ///
///////////////////////////////////////////////////////////////[/pawn]
Am incercat cu un pawno 0.3a primind tot 26 erori.
Si serverul de cand lam luat era 0.3c R2...
Astept raspunsul cuiva care chiar stie ce vorbeste.. si care m-ar putea ajuta sa solutionez problema pentru a putea deschide un server de samp. Nu doresc raspunsuri aiurea care nu ma ajuta cu nimic. Si va rog nu mai dati Lock topicului pana nu rezolv problema cum ati facut inainte. Multumesc pentru atentia acordata !
4 answers to this question
Recommended Posts