07.08.2011, 11:36
Can some one converter below code with zcmd for me please help
pawn Код:
#include <a_samp>
forward PlusPayDayZeit(playerid);
new PayDayZeit[MAX_PLAYERS];
new FirstSpawnOfPlayer[MAX_PLAYERS] = 0;
new PayDayTimer;
public OnFilterScriptInit()
{
print("| FOXPAYDAY v2.0 |");
return 1;
}
public OnFilterScriptExit()
{
print("| FOXPAYDAY v2.0 |");
return 1;
}
public OnPlayerSpawn(playerid)
{
if(FirstSpawnOfPlayer[playerid] == 0)
{
PayDayTimer = SetTimerEx("PlusPayDayZeit",300,1,"i",playerid);
FirstSpawnOfPlayer[playerid] = 1;
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd,"/paydayzeit",true)==0)
{
if(IsPlayerConnected(playerid))
{
for (new i = 0;i < 9; i++)
{
SendClientMessageToAll(0xFFFFFFAA," ");
}
new string[38];
format(string, sizeof(string), "Spielzeit seit dem letzten PayDay: %d",PayDayZeit[playerid]);
SendClientMessage(playerid,0xFFFFFFFF, string);
return 1;
}
}
return 1;
}
public OnPlayerDisconnect(playerid)
{
KillTimer(PayDayTimer);
return 1;
}
public PlusPayDayZeit(playerid)
{
PayDayZeit[playerid] += 1;
if(PayDayZeit[playerid] >= 1) //wenn PayDayZeit[playerid] 10 ist (pro 10 minuten)
{
new string[24];
new gZufallGehalt = random(5000);
if(gZufallGehalt < 4997) { gZufallGehalt += 3; }
format(string,sizeof(string),"~b~PayDay~n~~g~+%d$",gZufallGehalt);
GameTextForPlayer(playerid,string,2000,1);
GivePlayerMoney(playerid,gZufallGehalt);
PayDayZeit[playerid] = 0;
}
return 1;
}
stock strtok(const string[], &index,seperator=' ')
{
new length = strlen(string);
new offset = index;
new result[256];
while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
if ((index < length) && (string[index] == seperator))
{
index++;
}
return result;
}