14.05.2006, 18:03
(
Last edited by DracoBlue; 07/07/2010 at 10:06 PM.
)
|
Originally Posted by caytchen
Workaholic?
![]() |
.
am i doing something wrong?
|
Originally Posted by ******
The functions are in the .inc and their use can be derived from looking at the code. Do you have DUtils?
|
|
Originally Posted by DracoBlue
Do you have a folder called scriptfiles ?
|
strcat(tmpres,key); strcat(tmpres,"="); strcat(tmpres,value);
format(tmpres, 256, "%s=%d", key, value);
(
new sep[256]; format(sep,sizeof(sep),"=");
strcat(tmpres,"=");
strcat(tmpres,sep);

:PC:\DOCUME~1\Patrick\Desktop\Server\GAMEMO~1\src\RPG.pwn(664) : warning 202: number of arguments does not match definition Pawn compiler 3.0.3367 Copyright © 1997-2005, ITB CompuPhase 1 Warning.
if(strcmp(cmd, "/buy", true) == 0) {
new property=999;
GetPlayerName(playerid, pname, sizeof(pname));
if(IsPlayerInCheckpoint(playerid)) {
switch (playerCheckpoint[playerid]) {
case CP_XENDOT:{
property = P_XENDOT;
}
}
if(property==999) {
SendClientMessage(playerid, COLOR_YELLOW, "You need to be in a property checkpoint to /buy it.");
return 1;
}
// property--;
if(GetPlayerMoney(playerid) < propertyValues[property]) {
SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this property.");
return 1;
}
if(propertyOwner[property]==playerid) {
SendClientMessage(playerid, COLOR_RED, "You already own this property.");
return 1;
}
if(dini_Exists(udb_encode(propertyNames[property]))) {
tmp = dini_Get(propertyNames[property]);
format(string, sizeof(string), "This Property belongs to %s", tmp);
SendClientMessage(playerid, COLOR_RED, string);
return 1;
}
GivePlayerMoney(playerid, 0-propertyValues[property]);
propertyOwner[property]=playerid;
format(string, sizeof(string), "You have purchased the %s!", propertyNames[property]);
SendClientMessage(playerid, COLOR_GREEN, string);
dini_Create(udb_encode(propertyNames[property]));
dini_IntSet(udb_encode(propertyNames[property]), pname, 1);
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
new playermoney;
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new pname[256];
new cmd[256];
new giveplayerid, moneys, idx;
new tmp[256], tmp2[256];
new playername[MAX_PLAYER_NAME];
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/buy", true) == 0) {
new property=999;
GetPlayerName(playerid, pname, sizeof(pname));
if(IsPlayerInCheckpoint(playerid)) {
switch (playerCheckpoint[playerid]) {
case CP_AMMU:{
property = P_AMMU;
}
}
if(property==999) {
SendClientMessage(playerid, COLOR_YELLOW, "You need to be in a property checkpoint to /buy it.");
return 1;
}
// property--;
if(dini_Exists(udb_encode("Propertys.ini"))) {
tmp = dini_Get("Propertys.ini", propertyNames[property]);
format(string, sizeof(string), "This Property belongs to %s", tmp);
SendClientMessage(playerid, COLOR_RED, string);
return 1;
}
if(GetPlayerMoney(playerid) < propertyValues[property]) {
SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this property.");
return 1;
}
if(propertyOwner[property]==playerid) {
SendClientMessage(playerid, COLOR_RED, "You already own this property.");
return 1;
}
GivePlayerMoney(playerid, 0-propertyValues[property]);
propertyOwner[property]=playerid;
format(string, sizeof(string), "You have purchased the %s!", propertyNames[property]);
SendClientMessage(playerid, COLOR_GREEN, string);
dini_IntSet("Propertys.ini", propertyNames[property], pname);
}
return 1;
}
