Save date in variables..
#1

Код:
	CMD:premium(playerid, params[])
	{
 		if(PlayerInfo[playerid][pAdmin] >= 1337)
	    {
	    	new pid, Year, Month, Day, str[64];
	    	if(sscanf(params,"d02d02dd",pid, Day, Month, Year)) return SendClientMessage(playerid,COLOR_WHITE, "Utilizzo: /premium [playerid] [giorno] [mese] [anno]");
            if(!IsPlayerConnected(pid)) return SendClientMessage(playerid,COLOR_RED, "Il player da te specificato non и collegato");
			PlayerInfo[pid][pPremium] = 1;
			SendClientMessageEx(pid, COLOR_LIGHTBLUE, "Sei stato settato utente premium fino al %02d %02d %d", Day, Month, Year);
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Hai settato %s utente premium fino al %02d %02d %d", PlayerName(pid), Day, Month, Year);
			format(str, sizeof(str), "%d-%02d-%02d", Year, Month, Day);
			PlayerInfo[pid][pScadenza] = str[64]; // LINE OF ERROR
		}
		return 1;
	}
error 032: array index out of bounds (variable "str") - PlayerInfo[pid][pScadenza] = str[64];


Question: 2011-01-04 Is a string??
Reply
#2

PlayerInfo [ pid ] [ pScadenza ] = str;
Reply
#3

C:\Users\Tony\Desktop\Las Vegas RolePlay 0.3c\gamemodes\RGRP.pwn(1420) : error 047: array sizes do not match, or destination array is too small
Reply
#4

Try,
pawn Код:
PlayerInfo [ pid ] [ pScadenza ] = str[63];
Not sure if this will work.
Reply
#5

resolved in this metod:

Код:
	CMD:premium(playerid, params[])
	{
 		if(PlayerInfo[playerid][pAdmin] >= 1337)
	    {
	    	new pid, Year, Month, Day, str[19], var[20];
	    	if(sscanf(params,"d02d02dd",pid, Day, Month, Year)) return SendClientMessage(playerid,COLOR_WHITE, "Utilizzo: /premium [playerid] [giorno] [mese] [anno]");
            if(!IsPlayerConnected(pid)) return SendClientMessage(playerid,COLOR_RED, "Il player da te specificato non и collegato");
			PlayerInfo[pid][pPremium] = 1;
			SendClientMessageEx(pid, COLOR_LIGHTBLUE, "Sei stato settato utente premium fino al %02d %02d %d", Day, Month, Year);
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Hai settato %s utente premium fino al %02d %02d %d", PlayerName(pid), Day, Month, Year);
			format(str, 64, "%d-%02d-%02d", Year, Month, Day);
			var = str;
			PlayerInfo[pid][pScadenza] = var;
			OnPlayerDataSave(pid);
		}
		return 1;
	}
No warning..
Is correct?
Reply
#6

use strmid function...
strmid(playervariablestring, date, 0, strlen(string), 30);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)